brackets: Highlight the closing brackets of subshells and blocks. (Issue #226.)

This commit is contained in:
Daniel Shahaf 2015-10-30 20:20:30 +02:00
parent 28abb960de
commit c0dafd1d85
2 changed files with 7 additions and 2 deletions

View file

@ -299,6 +299,8 @@ _zsh_highlight_main_highlighter()
fi
else # $arg is a non-command word
case $arg in
$'\x29') style=$ZSH_HIGHLIGHT_STYLES[reserved-word];; # subshell
$'\x7d') style=$ZSH_HIGHLIGHT_STYLES[reserved-word];; # block
'--'*) style=$ZSH_HIGHLIGHT_STYLES[double-hyphen-option];;
'-'*) style=$ZSH_HIGHLIGHT_STYLES[single-hyphen-option];;
"'"*) style=$ZSH_HIGHLIGHT_STYLES[single-quoted-argument];;

View file

@ -27,12 +27,15 @@
# vim: ft=zsh sw=2 ts=2 et
# -------------------------------------------------------------------------------------------------
BUFFER='tar cf - * | (cd /target; tar xfp -)'
BUFFER='tar cf - * | (cd /target; tar xfp -) | { cat }'
expected_region_highlight=(
"1 3 $ZSH_HIGHLIGHT_STYLES[command]" # tar
"14 14 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # (
"15 16 $ZSH_HIGHLIGHT_STYLES[command]" # cd
"27 29 $ZSH_HIGHLIGHT_STYLES[command]" # tar
#"36 36 $ZSH_HIGHLIGHT_STYLES[?]" # )
"36 36 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # )
"40 40 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # {
"42 44 $ZSH_HIGHLIGHT_STYLES[command]" # cat
"46 46 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # }
)