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:
@@ -397,7 +397,9 @@ git-commit-last-msg() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nvim-man() {
|
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.
|
# Check for existence of man page.
|
||||||
command man -w "$1" >/dev/null || return
|
command man -w "$1" >/dev/null || return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user