zsh:funcs:nvim-man: Use man if option is passed

If an option without arguments like `--version` is passed, `nvim-man`
should use `command man` as well.
This commit is contained in:
2022-02-03 16:34:17 +01:00
parent e55652fd44
commit 46605c7a84

View File

@@ -397,7 +397,9 @@ git-commit-last-msg() {
}
nvim-man() {
if (( $+commands[nvim] && $# == 1 )); then
# Use nvim only if it exists, there was just one argument passed and that
# argument is not an option (e.g. `--version`)
if (( $+commands[nvim] && $# == 1 && $1 == ${1#-} )); then
# Check for existence of man page.
command man -w "$1" >/dev/null || return