command word: Avoid unknown-token highlighting whilst inputting the command word.

Adds the 'command-being-input' highlight.

Builds on top of the 'command-word-separator-v1' branch from PR #243.
This commit is contained in:
Daniel Shahaf 2015-11-27 08:51:49 +00:00
commit e13c86dfc2
3 changed files with 7 additions and 1 deletions

View file

@ -40,6 +40,7 @@
: ${ZSH_HIGHLIGHT_STYLES[precommand]:=fg=green,underline}
: ${ZSH_HIGHLIGHT_STYLES[commandseparator]:=none}
: ${ZSH_HIGHLIGHT_STYLES[hashed-command]:=fg=green}
: ${ZSH_HIGHLIGHT_STYLES[command-being-typed]:=fg=yellow,underline}
: ${ZSH_HIGHLIGHT_STYLES[path]:=underline}
: ${ZSH_HIGHLIGHT_STYLES[path_prefix]:=underline}
: ${ZSH_HIGHLIGHT_STYLES[globbing]:=fg=blue}
@ -347,6 +348,8 @@ _zsh_highlight_main_highlighter()
else
if _zsh_highlight_main_highlighter_check_path; then
style=$ZSH_HIGHLIGHT_STYLES[path]
elif (( ${#BUFFER} == $end_pos )); then
style=$ZSH_HIGHLIGHT_STYLES[command-being-typed]
else
style=$ZSH_HIGHLIGHT_STYLES[unknown-token]
fi