zsh:funcs:nvim-man: Use [[ for option check
"${1#-}" is not properly parsed in `((` when long options containing a
`=` are passed (`bad math expression: operand expected`).
This commit is contained in:
@@ -399,7 +399,7 @@ git-commit-last-msg() {
|
|||||||
nvim-man() {
|
nvim-man() {
|
||||||
# Use nvim only if it exists, there was just one argument passed, that
|
# Use nvim only if it exists, there was just one argument passed, that
|
||||||
# argument is not an option (e.g. `--version`) and stdout is a terminal.
|
# argument is not an option (e.g. `--version`) and stdout is a terminal.
|
||||||
if (( $+commands[nvim] && $# == 1 && $1 == ${1#-} )) && [[ -t 1 ]]; then
|
if (( $+commands[nvim] && $# == 1 )) && [[ $1 == ${1#-} && -t 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