'main': Highlight lone '!' correctly: it's not a history expansion.

While here, also add a test for the '!' reserved word (which is highlighted
since c216242b).
This commit is contained in:
Daniel Shahaf
2016-03-13 02:47:25 +00:00
parent e635f766be
commit 4c23a2fd1b
2 changed files with 7 additions and 3 deletions

View File

@@ -28,10 +28,12 @@
# -------------------------------------------------------------------------------------------------
ZSH_HIGHLIGHT_STYLES[default]=$unused_highlight
BUFFER='!foo bar !baz'
BUFFER='!foo bar !baz ! ; !'
expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[history-expansion]" # !foo
"6 8 $ZSH_HIGHLIGHT_STYLES[default]" # bar
"10 13 $ZSH_HIGHLIGHT_STYLES[history-expansion]" # !baz
"15 15 $ZSH_HIGHLIGHT_STYLES[default]" # ! (before the semicolon)
"19 19 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ! (after the semicolon)
)