Procházet zdrojové kódy

main: Fold '!' handling in to the 'case'. No functional change.

pull/566/head
Daniel Shahaf před 6 roky
rodič
revize
44b89f3307
1 změnil soubory, kde provedl 9 přidání a 5 odebrání
  1. +9
    -5
      highlighters/main/main-highlighter.zsh

+ 9
- 5
highlighters/main/main-highlighter.zsh Zobrazit soubor

@ -689,11 +689,7 @@ _zsh_highlight_main_highlighter_highlight_list()
case $res in
reserved) # reserved word
style=reserved-word
if [[ $arg == '!' && $this_word != *':start_of_pipeline:'* ]]; then
style=unknown-token
fi
#
# Match braces.
# Match braces and handle special cases.
case $arg in
($'\x7b')
braces_stack='Y'"$braces_stack"
@ -754,6 +750,14 @@ _zsh_highlight_main_highlighter_highlight_list()
#
# The repeat-count word will be handled like a redirection target.
this_word=':start::regular:'
;;
('!')
if [[ $this_word != *':start_of_pipeline:'* ]]; then
style=unknown-token
else
# '!' reserved word at start of pipeline; style already set above
fi
;;
esac
;;
'suffix alias') style=suffix-alias;;

Načítá se…
Zrušit
Uložit