'main': Highlight mismatched foreach/end.

Fixes #96.
This commit is contained in:
Daniel Shahaf
2016-09-25 09:20:40 +00:00
parent a2876fb57d
commit 2bb8f0703d
2 changed files with 51 additions and 0 deletions

View File

@@ -218,6 +218,7 @@ _zsh_highlight_highlighter_main_paint()
# "Q" for square
# "Y" for curly
# "D" for do/done
# "$" for 'end' (matches 'foreach' always; also used with cshjunkiequotes in repeat/while)
local braces_stack
if (( path_dirs_was_set )); then
@@ -468,6 +469,12 @@ _zsh_highlight_highlighter_main_paint()
('done')
_zsh_highlight_main__stack_pop 'D' style=reserved-word
;;
('foreach')
braces_stack='$'"$braces_stack"
;;
('end')
_zsh_highlight_main__stack_pop '$' style=reserved-word
;;
esac
;;
'suffix alias') style=suffix-alias;;