ソースを参照

main: Highlight =( ) process substitutions

pull/533/head
Matthew Martin 6年前
コミット
c0e64fe131
2個のファイルの変更12行の追加2行の削除
  1. +9
    -2
      highlighters/main/main-highlighter.zsh
  2. +3
    -0
      highlighters/main/test-data/process-substitution-redirection-isnt-globbing.zsh

+ 9
- 2
highlighters/main/main-highlighter.zsh ファイルの表示

@ -842,7 +842,7 @@ _zsh_highlight_main_highlighter_check_path()
# This command will at least highlight start_pos to end_pos with the default style
_zsh_highlight_main_highlighter_highlight_argument()
{
local base_style=default i path_eligible=1 start style
local base_style=default i=1 path_eligible=1 start style
local -a highlights
local -a match mbegin mend
@ -857,9 +857,16 @@ _zsh_highlight_main_highlighter_highlight_argument()
fi
path_eligible=0
;;
'=')
if [[ $arg[2] == $'\x28' ]]; then
(( i += 2 ))
_zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,end_pos]
(( i += REPLY ))
highlights+=($start_pos $(( start_pos + i )) process-substitution $reply)
fi
esac
for (( i = 1 ; i <= end_pos - start_pos ; i += 1 )); do
for (( ; i <= end_pos - start_pos ; i += 1 )); do
case "$arg[$i]" in
"\\") (( i += 1 )); continue;;
"'")

+ 3
- 0
highlighters/main/test-data/process-substitution-redirection-isnt-globbing.zsh ファイルの表示

@ -33,4 +33,7 @@ BUFFER=$': =(
expected_region_highlight=(
'1 1 builtin' # :
'3 9 default' # =(<foo)
'3 9 process-substitution' # =(<foo)
'5 5 redirection' # <foo
'6 8 default' # foo
)

読み込み中…
キャンセル
保存