comments: Mark prematurely-terminated command as an error.

This is already done for commands prematurely terminated by ";".
This commit is contained in:
Daniel Shahaf
2015-10-28 15:48:55 +02:00
parent 693de99a90
commit 1ac39b0af1
2 changed files with 43 additions and 2 deletions

View File

@@ -190,8 +190,11 @@ _zsh_highlight_main_highlighter()
fi
if [[ ${interactive_comments+'set'} && $arg[1] == $histchars[3] ]]; then
# TODO: check $this_word
style=$ZSH_HIGHLIGHT_STYLES[comment]
if [[ $this_word == *(':regular:'|':start:')* ]]; then
style=$ZSH_HIGHLIGHT_STYLES[comment]
else
style=$ZSH_HIGHLIGHT_STYLES[unknown-token] # prematurely terminated
fi
_zsh_highlight_main_add_region_highlight $start_pos $end_pos $style
already_added=1
continue