back-dollar-quoted-argument: Correct an off-by-one.

Highlight the last character of a «\xHH» escape when it is the last thing in
LBUFFER.  This is similar to what b0cc02ed86 did
for issue #186.
This commit is contained in:
Daniel Shahaf 2015-09-25 21:36:20 +00:00
commit 6732783d46
3 changed files with 41 additions and 1 deletions

View file

@ -311,7 +311,7 @@ _zsh_highlight_main_highlighter_highlight_dollar_string()
(( k = j + 1 ))
case "$arg[$i]" in
"\\") style=$ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]
for (( c = i + 1 ; c < end_pos - start_pos ; c += 1 )); do
for (( c = i + 1 ; c <= end_pos - start_pos ; c += 1 )); do
[[ "$arg[$c]" != ([0-9xXuUa-fA-F]) ]] && break
done
AA=$arg[$i+1,$c-1]