Fix part of issue #238, "fd redirections at command word".

This fixes fd's specified by a (single) digit.  The named fd syntax remains an XFail.
This commit is contained in:
Daniel Shahaf
2015-11-29 03:11:50 +00:00
parent 48ecd29180
commit 73ee7c1f6c
2 changed files with 5 additions and 4 deletions

View File

@@ -320,7 +320,8 @@ _zsh_highlight_main_highlighter()
else
style=$ZSH_HIGHLIGHT_STYLES[unknown-token]
fi
elif [[ $arg[1] == '<' || $arg[1] == '>' ]]; then
elif [[ $arg == (<0-9>|)(\<|\>)* ]]; then
# A '<' or '>', possibly followed by a digit
style=$ZSH_HIGHLIGHT_STYLES[redirection]
(( in_redirection=2 ))
elif [[ $arg[1,2] == '((' ]]; then
@@ -389,7 +390,7 @@ _zsh_highlight_main_highlighter()
else
style=$ZSH_HIGHLIGHT_STYLES[unknown-token]
fi
elif [[ $arg[1] == '<' || $arg[1] == '>' ]]; then
elif [[ $arg == (<0-9>|)(\<|\>)* ]]; then
style=$ZSH_HIGHLIGHT_STYLES[redirection]
(( in_redirection=2 ))
else