diff --git a/highlighters/brackets/test-data/mismatch-patentheses.zsh b/highlighters/brackets/test-data/mismatch-patentheses.zsh index 5671079..b45b868 100644 --- a/highlighters/brackets/test-data/mismatch-patentheses.zsh +++ b/highlighters/brackets/test-data/mismatch-patentheses.zsh @@ -30,8 +30,8 @@ BUFFER='echo ({x}]' expected_region_highlight=( - "6 6 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # ( - "7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # { - "9 9 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # } - "10 10 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # ) + "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # ( + "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # { + "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # } + "10 10 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # ) ) diff --git a/highlighters/brackets/test-data/nested-parentheses.zsh b/highlighters/brackets/test-data/nested-parentheses.zsh index 291f8f4..028aed1 100644 --- a/highlighters/brackets/test-data/nested-parentheses.zsh +++ b/highlighters/brackets/test-data/nested-parentheses.zsh @@ -30,10 +30,10 @@ BUFFER='echo $(echo ${(z)array})' expected_region_highlight=( - "7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # ( - "14 14 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # { - "15 15 $ZSH_HIGHLIGHT_STYLES[bracket-level-3]" # ( - "17 17 $ZSH_HIGHLIGHT_STYLES[bracket-level-3]" # ) - "23 23 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # } - "24 24 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # ) + "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # ( + "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # { + "15 15 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-3]}" # ( + "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-3]}" # ) + "23 23 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # } + "24 24 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # ) ) diff --git a/highlighters/brackets/test-data/quoted-patentheses.zsh b/highlighters/brackets/test-data/quoted-patentheses.zsh index a2c52c4..5819180 100644 --- a/highlighters/brackets/test-data/quoted-patentheses.zsh +++ b/highlighters/brackets/test-data/quoted-patentheses.zsh @@ -30,5 +30,5 @@ BUFFER='echo "foo ( bar"' expected_region_highlight=( -"1 16 $ZSH_HIGHLIGHT_STYLES[none]" # We expect the brackets highlighter to do nothing +"1 16 ${(q-)ZSH_HIGHLIGHT_STYLES[none]}" # We expect the brackets highlighter to do nothing ) diff --git a/highlighters/brackets/test-data/simple-parentheses.zsh b/highlighters/brackets/test-data/simple-parentheses.zsh index 893145f..8e0c1a3 100644 --- a/highlighters/brackets/test-data/simple-parentheses.zsh +++ b/highlighters/brackets/test-data/simple-parentheses.zsh @@ -30,8 +30,8 @@ BUFFER='echo ({x})' expected_region_highlight=( - "6 6 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # ( - "7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # { - "9 9 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # } - "10 10 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # ) + "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # ( + "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # { + "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # } + "10 10 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # ) ) diff --git a/highlighters/brackets/test-data/unclosed-patentheses.zsh b/highlighters/brackets/test-data/unclosed-patentheses.zsh index c36ba36..4edfc46 100644 --- a/highlighters/brackets/test-data/unclosed-patentheses.zsh +++ b/highlighters/brackets/test-data/unclosed-patentheses.zsh @@ -30,7 +30,7 @@ BUFFER='echo ({x}' expected_region_highlight=( - "6 6 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # ( - "7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # { - "9 9 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # } + "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # ( + "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # { + "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # } ) diff --git a/highlighters/brackets/test-data/unclosed-patentheses2.zsh b/highlighters/brackets/test-data/unclosed-patentheses2.zsh index 04c246b..15c7fbe 100644 --- a/highlighters/brackets/test-data/unclosed-patentheses2.zsh +++ b/highlighters/brackets/test-data/unclosed-patentheses2.zsh @@ -30,7 +30,7 @@ BUFFER='echo {x})' expected_region_highlight=( - "6 6 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # { - "8 8 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # } - "9 9 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # ) + "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # { + "8 8 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # } + "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # ) ) diff --git a/highlighters/main/test-data/alias-assignment1.zsh b/highlighters/main/test-data/alias-assignment1.zsh index 9ecbead..435b72d 100644 --- a/highlighters/main/test-data/alias-assignment1.zsh +++ b/highlighters/main/test-data/alias-assignment1.zsh @@ -34,5 +34,5 @@ ZSH_HIGHLIGHT_STYLES[alias]=$unused_highlight BUFFER='x=y ls' expected_region_highlight=( - "1 3 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # x=y + "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # x=y ) diff --git a/highlighters/main/test-data/alias.zsh b/highlighters/main/test-data/alias.zsh index aa84a58..ea804fa 100644 --- a/highlighters/main/test-data/alias.zsh +++ b/highlighters/main/test-data/alias.zsh @@ -43,9 +43,9 @@ BUFFER='x.alias2; alias1' expected_region_highlight=() if [[ "$(type -w x.alias2)" == *suffix* ]]; then expected_region_highlight+=( - "1 8 $ZSH_HIGHLIGHT_STYLES[suffix-alias]" # x.alias2 + "1 8 ${(q-)ZSH_HIGHLIGHT_STYLES[suffix-alias]}" # x.alias2 ) fi expected_region_highlight+=( - "11 16 $ZSH_HIGHLIGHT_STYLES[alias]" # alias1 + "11 16 ${(q-)ZSH_HIGHLIGHT_STYLES[alias]}" # alias1 ) diff --git a/highlighters/main/test-data/anonymous-function.zsh b/highlighters/main/test-data/anonymous-function.zsh index 62714ed..57ab884 100644 --- a/highlighters/main/test-data/anonymous-function.zsh +++ b/highlighters/main/test-data/anonymous-function.zsh @@ -30,11 +30,11 @@ BUFFER='() echo hello; () { echo world }' expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # () - "4 7 $ZSH_HIGHLIGHT_STYLES[command]" # echo - "9 13 $ZSH_HIGHLIGHT_STYLES[default]" # hello - "14 14 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; - "16 17 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # () - "19 19 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # { - "21 24 $ZSH_HIGHLIGHT_STYLES[command]" # echo + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # () + "4 7 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # echo + "9 13 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # hello + "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; + "16 17 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # () + "19 19 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # { + "21 24 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # echo ) diff --git a/highlighters/main/test-data/arithmetic-evaluation.zsh b/highlighters/main/test-data/arithmetic-evaluation.zsh index 9287e91..e5caaa8 100644 --- a/highlighters/main/test-data/arithmetic-evaluation.zsh +++ b/highlighters/main/test-data/arithmetic-evaluation.zsh @@ -35,6 +35,6 @@ BUFFER='(( x == 42 ))' expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # (( - "12 13 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # )) + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # (( + "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # )) ) diff --git a/highlighters/main/test-data/assign-append.zsh b/highlighters/main/test-data/assign-append.zsh index a38cd86..094ea3f 100644 --- a/highlighters/main/test-data/assign-append.zsh +++ b/highlighters/main/test-data/assign-append.zsh @@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight BUFFER='a+=(lorem ipsum)' expected_region_highlight=( - "1 4 $ZSH_HIGHLIGHT_STYLES[assign]" # a+=( + "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # a+=( ) diff --git a/highlighters/main/test-data/assign-array.zsh b/highlighters/main/test-data/assign-array.zsh index c530fda..377a4cc 100644 --- a/highlighters/main/test-data/assign-array.zsh +++ b/highlighters/main/test-data/assign-array.zsh @@ -31,8 +31,8 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight BUFFER='(A=(hello world))' expected_region_highlight=( - "1 1 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ( - "2 4 $ZSH_HIGHLIGHT_STYLES[assign]" # A=( - "16 16 $ZSH_HIGHLIGHT_STYLES[assign]" # ) - "17 17 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ) + "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ( + "2 4 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # A=( + "16 16 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # ) + "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ) ) diff --git a/highlighters/main/test-data/assign-semicolon.zsh b/highlighters/main/test-data/assign-semicolon.zsh index c3692d4..e76d260 100644 --- a/highlighters/main/test-data/assign-semicolon.zsh +++ b/highlighters/main/test-data/assign-semicolon.zsh @@ -31,6 +31,6 @@ ZSH_HIGHLIGHT_STYLES[commandseparator]=$unused_highlight BUFFER='A=1; echo hello world' expected_region_highlight=( - "4 4 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; - "6 9 $ZSH_HIGHLIGHT_STYLES[command]" # echo + "4 4 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; + "6 9 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # echo ) diff --git a/highlighters/main/test-data/assign-subshell.zsh b/highlighters/main/test-data/assign-subshell.zsh index 871936f..784c968 100644 --- a/highlighters/main/test-data/assign-subshell.zsh +++ b/highlighters/main/test-data/assign-subshell.zsh @@ -31,7 +31,7 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight BUFFER='(A=1)' expected_region_highlight=( - "1 1 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ( - "2 4 $ZSH_HIGHLIGHT_STYLES[assign]" # A=1 - "5 5 $ZSH_HIGHLIGHT_STYLES[reserved-word] 'issue #231'" # ) + "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ( + "2 4 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # A=1 + "5 5 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]} 'issue #231'" # ) ) diff --git a/highlighters/main/test-data/assign.zsh b/highlighters/main/test-data/assign.zsh index 7510aba..443fff8 100644 --- a/highlighters/main/test-data/assign.zsh +++ b/highlighters/main/test-data/assign.zsh @@ -31,8 +31,8 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight BUFFER='A=1 b=("foo" bar)' expected_region_highlight=( - "1 3 $ZSH_HIGHLIGHT_STYLES[assign]" # A=1 - "5 7 $ZSH_HIGHLIGHT_STYLES[assign]" # b=( - "8 12 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "foo" - "17 17 $ZSH_HIGHLIGHT_STYLES[assign]" # ) + "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # A=1 + "5 7 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # b=( + "8 12 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo" + "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # ) ) diff --git a/highlighters/main/test-data/back-quoted-argument.zsh b/highlighters/main/test-data/back-quoted-argument.zsh index 6dfba71..cb182b5 100644 --- a/highlighters/main/test-data/back-quoted-argument.zsh +++ b/highlighters/main/test-data/back-quoted-argument.zsh @@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[back-quoted-argument]=$unused_highlight BUFFER='echo `echo 42`' expected_region_highlight=( - "6 14 $ZSH_HIGHLIGHT_STYLES[back-quoted-argument]" + "6 14 ${(q-)ZSH_HIGHLIGHT_STYLES[back-quoted-argument]}" ) diff --git a/highlighters/main/test-data/commandseparator.zsh b/highlighters/main/test-data/commandseparator.zsh index 7c152ff..1f66f3f 100644 --- a/highlighters/main/test-data/commandseparator.zsh +++ b/highlighters/main/test-data/commandseparator.zsh @@ -32,8 +32,8 @@ ZSH_HIGHLIGHT_STYLES[commandseparator]=$unused_highlight BUFFER=':; pwd &! ls' expected_region_highlight=( - "2 2 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; - "4 6 $ZSH_HIGHLIGHT_STYLES[builtin]" # pwd - "8 9 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # &! - "11 12 $ZSH_HIGHLIGHT_STYLES[command]" # ls + "2 2 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; + "4 6 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # pwd + "8 9 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # &! + "11 12 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls ) diff --git a/highlighters/main/test-data/comments.zsh b/highlighters/main/test-data/comments.zsh index f1b8108..24ed51c 100644 --- a/highlighters/main/test-data/comments.zsh +++ b/highlighters/main/test-data/comments.zsh @@ -32,7 +32,7 @@ setopt interactive_comments BUFFER='echo "foo #bar" #baz # quux' expected_region_highlight=( - "1 4 $ZSH_HIGHLIGHT_STYLES[command]" # echo - "6 15 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "foo #bar" + "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # echo + "6 15 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo #bar" "17 27 ${(q-)ZSH_HIGHLIGHT_STYLES[comment]}" # #baz # quux ) diff --git a/highlighters/main/test-data/commmand-parameter.zsh b/highlighters/main/test-data/commmand-parameter.zsh index a2b756c..4cffde7 100644 --- a/highlighters/main/test-data/commmand-parameter.zsh +++ b/highlighters/main/test-data/commmand-parameter.zsh @@ -31,6 +31,6 @@ x=/usr/bin/env BUFFER='$x "argument"' expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[command]" # $x - "4 13 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "argument" + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # $x + "4 13 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "argument" ) diff --git a/highlighters/main/test-data/control-flow.zsh b/highlighters/main/test-data/control-flow.zsh index 3107f50..1de787b 100644 --- a/highlighters/main/test-data/control-flow.zsh +++ b/highlighters/main/test-data/control-flow.zsh @@ -31,21 +31,21 @@ ZSH_HIGHLIGHT_STYLES[alias]=$unused_highlight BUFFER='while if echo Hello; then ls /; else ls; fi; do stat "x"; done; repeat 10 ls' expected_region_highlight+=( - "1 5 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # while - "7 8 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # if - "10 13 $ZSH_HIGHLIGHT_STYLES[builtin]" # echo - "15 19 $ZSH_HIGHLIGHT_STYLES[default]" # Hello - "22 25 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # then - "27 28 $ZSH_HIGHLIGHT_STYLES[command]" # ls - "30 30 $ZSH_HIGHLIGHT_STYLES[path]" # / - "31 31 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; - "33 36 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # else - "38 39 $ZSH_HIGHLIGHT_STYLES[command]" # ls - "42 43 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # fi - "46 47 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # do - "49 52 $ZSH_HIGHLIGHT_STYLES[command]" # stat - "54 56 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "x" - "59 62 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # done - "65 70 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # repeat - "75 76 $ZSH_HIGHLIGHT_STYLES[command]" # ls + "1 5 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # while + "7 8 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # if + "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo + "15 19 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # Hello + "22 25 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # then + "27 28 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "30 30 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # / + "31 31 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; + "33 36 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # else + "38 39 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "42 43 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # fi + "46 47 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # do + "49 52 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # stat + "54 56 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "x" + "59 62 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # done + "65 70 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # repeat + "75 76 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls ) diff --git a/highlighters/main/test-data/dollar-quoted.zsh b/highlighters/main/test-data/dollar-quoted.zsh index ea12f9f..f8ffefa 100644 --- a/highlighters/main/test-data/dollar-quoted.zsh +++ b/highlighters/main/test-data/dollar-quoted.zsh @@ -31,6 +31,6 @@ ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]=$unused_highlight BUFFER=": \$'*' 'foo'" expected_region_highlight=( - "3 6 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # $'*' - not a glob - "8 12 $ZSH_HIGHLIGHT_STYLES[single-quoted-argument]" # 'foo' + "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # $'*' - not a glob + "8 12 ${(q-)ZSH_HIGHLIGHT_STYLES[single-quoted-argument]}" # 'foo' ) diff --git a/highlighters/main/test-data/dollar-quoted2.zsh b/highlighters/main/test-data/dollar-quoted2.zsh index 1ce9bb4..a29edbb 100644 --- a/highlighters/main/test-data/dollar-quoted2.zsh +++ b/highlighters/main/test-data/dollar-quoted2.zsh @@ -31,11 +31,11 @@ ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]=$unused_highlight BUFFER=": \$'foo\xbar\udeadbeef\uzzzz'" expected_region_highlight=( - "3 7 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # $'foo - "8 11 $ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]" # \xba - "12 12 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # r - "13 18 $ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]" # \dead - "19 22 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # beef - "23 24 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # \u - "25 29 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # zzzz' + "3 7 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # $'foo + "8 11 ${(q-)ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]}" # \xba + "12 12 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # r + "13 18 ${(q-)ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]}" # \dead + "19 22 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # beef + "23 24 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # \u + "25 29 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # zzzz' ) diff --git a/highlighters/main/test-data/dollar-quoted3.zsh b/highlighters/main/test-data/dollar-quoted3.zsh index 53ee171..eb1ee82 100644 --- a/highlighters/main/test-data/dollar-quoted3.zsh +++ b/highlighters/main/test-data/dollar-quoted3.zsh @@ -33,6 +33,6 @@ ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]=$unused_highlight BUFFER=": \$'\xa1" expected_region_highlight=( - "3 4 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # $' - "5 8 $ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]" # \xa1 + "3 4 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # $' + "5 8 ${(q-)ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]}" # \xa1 ) diff --git a/highlighters/main/test-data/double-hyphen-option.zsh b/highlighters/main/test-data/double-hyphen-option.zsh index b87ebe8..eb7514f 100644 --- a/highlighters/main/test-data/double-hyphen-option.zsh +++ b/highlighters/main/test-data/double-hyphen-option.zsh @@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=$unused_highlight BUFFER='hello --world' expected_region_highlight=( - "7 13 $ZSH_HIGHLIGHT_STYLES[double-hyphen-option]" # --world + "7 13 ${(q-)ZSH_HIGHLIGHT_STYLES[double-hyphen-option]}" # --world ) diff --git a/highlighters/main/test-data/double-quoted.zsh b/highlighters/main/test-data/double-quoted.zsh index 3f80f9e..ececcca 100644 --- a/highlighters/main/test-data/double-quoted.zsh +++ b/highlighters/main/test-data/double-quoted.zsh @@ -31,15 +31,15 @@ BUFFER=': "foo$bar:\`:\":\$:' BUFFER+=\\\\:\" expected_region_highlight=( - "3 6 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "foo - "7 10 $ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]" # $bar - "11 11 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # : - "12 13 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \` - "14 14 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # : - "15 16 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \$ - "17 17 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # : - "18 19 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \" - "20 20 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # : - "21 22 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \\ - "23 24 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # :" + "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo + "7 10 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # $bar + "11 11 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # : + "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \` + "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # : + "15 16 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \$ + "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # : + "18 19 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \" + "20 20 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # : + "21 22 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \\ + "23 24 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # :" ) diff --git a/highlighters/main/test-data/double-quoted2.zsh b/highlighters/main/test-data/double-quoted2.zsh index b29c884..dcae235 100644 --- a/highlighters/main/test-data/double-quoted2.zsh +++ b/highlighters/main/test-data/double-quoted2.zsh @@ -32,6 +32,6 @@ BUFFER=': "foo$bar' expected_region_highlight=( - "3 6 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "foo - "7 10 $ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]" # $bar + "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo + "7 10 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # $bar ) diff --git a/highlighters/main/test-data/double-quoted3.zsh b/highlighters/main/test-data/double-quoted3.zsh index 96408fa..efbcd63 100644 --- a/highlighters/main/test-data/double-quoted3.zsh +++ b/highlighters/main/test-data/double-quoted3.zsh @@ -31,9 +31,9 @@ BUFFER=': "$" "$42foo"' BUFFER+=\ \"\\\'\\x\" expected_region_highlight=( - "3 5 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "$" - "7 7 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # " - "8 10 $ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]" # $42 - "11 14 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # foo" - "16 21 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "\'\x" - \' and \x are not escape sequences + "3 5 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "$" + "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # " + "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # $42 + "11 14 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # foo" + "16 21 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "\'\x" - \' and \x are not escape sequences ) diff --git a/highlighters/main/test-data/double-quoted4.zsh b/highlighters/main/test-data/double-quoted4.zsh index 3355fc2..4a1e205 100644 --- a/highlighters/main/test-data/double-quoted4.zsh +++ b/highlighters/main/test-data/double-quoted4.zsh @@ -30,7 +30,7 @@ BUFFER=': "${foo}bar"' expected_region_highlight=( - "3 3 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # " - "4 9 $ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]" # ${foo} - "10 13 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # bar" + "3 3 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # " + "4 9 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # ${foo} + "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # bar" ) diff --git a/highlighters/main/test-data/empty-command.zsh b/highlighters/main/test-data/empty-command.zsh index 9e4b13f..4da62ba 100644 --- a/highlighters/main/test-data/empty-command.zsh +++ b/highlighters/main/test-data/empty-command.zsh @@ -30,6 +30,6 @@ BUFFER='echo; ;' expected_region_highlight=( - "5 5 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; - "7 7 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # ; + "5 5 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; + "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ; ) diff --git a/highlighters/main/test-data/empty-command2.zsh b/highlighters/main/test-data/empty-command2.zsh index a888ffe..a4d5538 100644 --- a/highlighters/main/test-data/empty-command2.zsh +++ b/highlighters/main/test-data/empty-command2.zsh @@ -33,6 +33,6 @@ touch ';' BUFFER='echo; ;' expected_region_highlight=( - "5 5 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; - "7 7 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # ; + "5 5 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; + "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ; ) diff --git a/highlighters/main/test-data/exec-redirection1.zsh b/highlighters/main/test-data/exec-redirection1.zsh index 880cfea..9d74587 100644 --- a/highlighters/main/test-data/exec-redirection1.zsh +++ b/highlighters/main/test-data/exec-redirection1.zsh @@ -31,9 +31,9 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight BUFFER='exec {foo}>&/tmp ls' expected_region_highlight=( - "1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # exec - # TODO: "6 10 $ZSH_HIGHLIGHT_STYLES[redirection] 'issue #238'" # {foo} - "11 12 $ZSH_HIGHLIGHT_STYLES[redirection]" # >& - "13 16 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp - "18 19 $ZSH_HIGHLIGHT_STYLES[command] 'issue #238'" # ls + "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # exec + # TODO: "6 10 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]} 'issue #238'" # {foo} + "11 12 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # >& + "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp + "18 19 ${(q-)ZSH_HIGHLIGHT_STYLES[command]} 'issue #238'" # ls ) diff --git a/highlighters/main/test-data/function.zsh b/highlighters/main/test-data/function.zsh index 3e579ab..fa19b91 100644 --- a/highlighters/main/test-data/function.zsh +++ b/highlighters/main/test-data/function.zsh @@ -39,8 +39,8 @@ BUFFER='cd;ls' # Use $unused_highlight to see that function highlighting has precedence over command and builtin expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[function]" # cd - "4 5 $ZSH_HIGHLIGHT_STYLES[function]" # ls + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[function]}" # cd + "4 5 ${(q-)ZSH_HIGHLIGHT_STYLES[function]}" # ls ) # don't 'unfunction cd ls', since cd() and ls() should still be a functions diff --git a/highlighters/main/test-data/glob.zsh b/highlighters/main/test-data/glob.zsh index d808e2b..6d4609e 100644 --- a/highlighters/main/test-data/glob.zsh +++ b/highlighters/main/test-data/glob.zsh @@ -30,9 +30,9 @@ BUFFER=': foo* bar? *baz qux\?' expected_region_highlight=( - "1 1 $ZSH_HIGHLIGHT_STYLES[builtin]" # : - "3 6 $ZSH_HIGHLIGHT_STYLES[globbing]" # foo* - "8 11 $ZSH_HIGHLIGHT_STYLES[globbing]" # bar? - "13 16 $ZSH_HIGHLIGHT_STYLES[globbing]" # *baz - "18 22 $ZSH_HIGHLIGHT_STYLES[default]" # qux\? + "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # : + "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # foo* + "8 11 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # bar? + "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # *baz + "18 22 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # qux\? ) diff --git a/highlighters/main/test-data/hashed-command.zsh b/highlighters/main/test-data/hashed-command.zsh index ce41b45..121f0b8 100644 --- a/highlighters/main/test-data/hashed-command.zsh +++ b/highlighters/main/test-data/hashed-command.zsh @@ -32,5 +32,5 @@ ZSH_HIGHLIGHT_STYLES[hashed-command]=$unused_highlight BUFFER='zsh_syntax_highlighting_hash' expected_region_highlight=( - "1 28 $ZSH_HIGHLIGHT_STYLES[hashed-command]" + "1 28 ${(q-)ZSH_HIGHLIGHT_STYLES[hashed-command]}" ) diff --git a/highlighters/main/test-data/history-expansion.zsh b/highlighters/main/test-data/history-expansion.zsh index 0e818b8..6980b8d 100644 --- a/highlighters/main/test-data/history-expansion.zsh +++ b/highlighters/main/test-data/history-expansion.zsh @@ -31,9 +31,9 @@ ZSH_HIGHLIGHT_STYLES[default]=$unused_highlight BUFFER='!foo bar !baz ! ; !' expected_region_highlight=( - "1 4 $ZSH_HIGHLIGHT_STYLES[history-expansion]" # !foo - "6 8 $ZSH_HIGHLIGHT_STYLES[default]" # bar - "10 13 $ZSH_HIGHLIGHT_STYLES[history-expansion]" # !baz - "15 15 $ZSH_HIGHLIGHT_STYLES[default]" # ! (before the semicolon) - "19 19 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ! (after the semicolon) + "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[history-expansion]}" # !foo + "6 8 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # bar + "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[history-expansion]}" # !baz + "15 15 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # ! (before the semicolon) + "19 19 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ! (after the semicolon) ) diff --git a/highlighters/main/test-data/history-expansion2.zsh b/highlighters/main/test-data/history-expansion2.zsh index 45af624..3840b55 100644 --- a/highlighters/main/test-data/history-expansion2.zsh +++ b/highlighters/main/test-data/history-expansion2.zsh @@ -30,5 +30,5 @@ BUFFER='^foo^bar' expected_region_highlight=( - "1 8 $ZSH_HIGHLIGHT_STYLES[history-expansion]" # ^foo^bar + "1 8 ${(q-)ZSH_HIGHLIGHT_STYLES[history-expansion]}" # ^foo^bar ) diff --git a/highlighters/main/test-data/multiline-string.zsh b/highlighters/main/test-data/multiline-string.zsh index 987dd20..c393812 100644 --- a/highlighters/main/test-data/multiline-string.zsh +++ b/highlighters/main/test-data/multiline-string.zsh @@ -31,6 +31,6 @@ PREBUFFER=$'echo "foo1\n' BUFFER='foo2" ./' expected_region_highlight=( - "1 5 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # 'foo2"' - "7 8 $ZSH_HIGHLIGHT_STYLES[path]" # './' + "1 5 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # 'foo2"' + "7 8 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # './' ) diff --git a/highlighters/main/test-data/multiline-string2.zsh b/highlighters/main/test-data/multiline-string2.zsh index 9753e5d..eafb17b 100644 --- a/highlighters/main/test-data/multiline-string2.zsh +++ b/highlighters/main/test-data/multiline-string2.zsh @@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=$unused_highlight BUFFER=$'echo "foo1\n' expected_region_highlight=( - "6 10 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # 'foo2"' + "6 10 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # 'foo2"' ) diff --git a/highlighters/main/test-data/multiple-redirections.zsh b/highlighters/main/test-data/multiple-redirections.zsh index 374de8a..e842239 100644 --- a/highlighters/main/test-data/multiple-redirections.zsh +++ b/highlighters/main/test-data/multiple-redirections.zsh @@ -30,17 +30,17 @@ BUFFER='ps aux | grep java | sort | uniq | tail | head' expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ps - "4 6 $ZSH_HIGHLIGHT_STYLES[default]" # aux - "8 8 $ZSH_HIGHLIGHT_STYLES[default]" # | - "10 13 $ZSH_HIGHLIGHT_STYLES[command]" # grep - "15 18 $ZSH_HIGHLIGHT_STYLES[default]" # java - "20 20 $ZSH_HIGHLIGHT_STYLES[default]" # | - "22 25 $ZSH_HIGHLIGHT_STYLES[command]" # sort - "27 27 $ZSH_HIGHLIGHT_STYLES[default]" # | - "29 32 $ZSH_HIGHLIGHT_STYLES[command]" # uniq - "34 34 $ZSH_HIGHLIGHT_STYLES[default]" # | - "36 39 $ZSH_HIGHLIGHT_STYLES[command]" # tail - "41 41 $ZSH_HIGHLIGHT_STYLES[default]" # | - "43 46 $ZSH_HIGHLIGHT_STYLES[command]" # head + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ps + "4 6 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # aux + "8 8 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # | + "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # grep + "15 18 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # java + "20 20 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # | + "22 25 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # sort + "27 27 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # | + "29 32 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # uniq + "34 34 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # | + "36 39 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # tail + "41 41 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # | + "43 46 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # head ) diff --git a/highlighters/main/test-data/noglob-alias.zsh b/highlighters/main/test-data/noglob-alias.zsh index 44d253a..df8ad23 100644 --- a/highlighters/main/test-data/noglob-alias.zsh +++ b/highlighters/main/test-data/noglob-alias.zsh @@ -31,5 +31,5 @@ alias x=command BUFFER='x ls' expected_region_highlight=( - "3 4 $ZSH_HIGHLIGHT_STYLES[command]" # ls + "3 4 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls ) diff --git a/highlighters/main/test-data/noglob1.zsh b/highlighters/main/test-data/noglob1.zsh index d9bc69b..52e8f57 100644 --- a/highlighters/main/test-data/noglob1.zsh +++ b/highlighters/main/test-data/noglob1.zsh @@ -30,5 +30,5 @@ BUFFER=':; noglob echo *' expected_region_highlight=( - "16 16 $ZSH_HIGHLIGHT_STYLES[default]" # * + "16 16 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # * ) diff --git a/highlighters/main/test-data/noglob2.zsh b/highlighters/main/test-data/noglob2.zsh index 2c19250..c51ca8d 100644 --- a/highlighters/main/test-data/noglob2.zsh +++ b/highlighters/main/test-data/noglob2.zsh @@ -30,6 +30,6 @@ BUFFER='noglob echo *; echo *' expected_region_highlight=( - "13 13 $ZSH_HIGHLIGHT_STYLES[default]" # * - "21 21 $ZSH_HIGHLIGHT_STYLES[globbing]" # * + "13 13 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # * + "21 21 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # * ) diff --git a/highlighters/main/test-data/option-path_dirs.zsh b/highlighters/main/test-data/option-path_dirs.zsh index 21434c4..e1de805 100644 --- a/highlighters/main/test-data/option-path_dirs.zsh +++ b/highlighters/main/test-data/option-path_dirs.zsh @@ -37,5 +37,5 @@ path+=( "$PWD"/foo ) BUFFER='bar/testing-issue-228' expected_region_highlight=( - "1 21 $ZSH_HIGHLIGHT_STYLES[command]" # bar/testing-issue-228 + "1 21 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # bar/testing-issue-228 ) diff --git a/highlighters/main/test-data/path-space.zsh b/highlighters/main/test-data/path-space.zsh index 7d473a7..d4c9fa6 100644 --- a/highlighters/main/test-data/path-space.zsh +++ b/highlighters/main/test-data/path-space.zsh @@ -32,6 +32,6 @@ touch "A/mu with spaces" BUFFER='ls A/mu\ with\ spaces' expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls - "4 19 $ZSH_HIGHLIGHT_STYLES[path]" # A/mu\ with\ spaces + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "4 19 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # A/mu\ with\ spaces ) diff --git a/highlighters/main/test-data/path-tilde-home.zsh b/highlighters/main/test-data/path-tilde-home.zsh index 31ad1e9..c5ed284 100644 --- a/highlighters/main/test-data/path-tilde-home.zsh +++ b/highlighters/main/test-data/path-tilde-home.zsh @@ -31,6 +31,6 @@ HOME="." BUFFER='ls ~' expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls - "4 4 $ZSH_HIGHLIGHT_STYLES[path]" # ~ + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "4 4 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # ~ ) diff --git a/highlighters/main/test-data/path-tilde-home2.zsh b/highlighters/main/test-data/path-tilde-home2.zsh index 18dd17b..0726a85 100644 --- a/highlighters/main/test-data/path-tilde-home2.zsh +++ b/highlighters/main/test-data/path-tilde-home2.zsh @@ -31,7 +31,7 @@ HOME="/nonexistent" BUFFER='ls ~' expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls - "4 4 $ZSH_HIGHLIGHT_STYLES[default]" # ~ + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "4 4 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # ~ ) diff --git a/highlighters/main/test-data/path-tilde-named.zsh b/highlighters/main/test-data/path-tilde-named.zsh index 235cc1c..3e396bd 100644 --- a/highlighters/main/test-data/path-tilde-named.zsh +++ b/highlighters/main/test-data/path-tilde-named.zsh @@ -34,6 +34,6 @@ hash -d D=mydir BUFFER='ls ~D/path-tilde-named.test' expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls - "4 27 $ZSH_HIGHLIGHT_STYLES[path]" # ~D/path-tilde-named.test + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "4 27 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # ~D/path-tilde-named.test ) diff --git a/highlighters/main/test-data/path.zsh b/highlighters/main/test-data/path.zsh index 29384c2..028b4e3 100644 --- a/highlighters/main/test-data/path.zsh +++ b/highlighters/main/test-data/path.zsh @@ -32,6 +32,6 @@ touch A/mu BUFFER='ls A/mu' expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls - "4 7 $ZSH_HIGHLIGHT_STYLES[path]" # A/mu + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "4 7 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # A/mu ) diff --git a/highlighters/main/test-data/path_prefix.zsh b/highlighters/main/test-data/path_prefix.zsh index 17cd26c..daa0c4b 100644 --- a/highlighters/main/test-data/path_prefix.zsh +++ b/highlighters/main/test-data/path_prefix.zsh @@ -34,5 +34,5 @@ ZSH_HIGHLIGHT_STYLES[path_prefix]=$unused_highlight BUFFER='ls /bin/s' expected_region_highlight=( - "4 9 $ZSH_HIGHLIGHT_STYLES[path_prefix]" # /bin/s + "4 9 ${(q-)ZSH_HIGHLIGHT_STYLES[path_prefix]}" # /bin/s ) diff --git a/highlighters/main/test-data/path_prefix2.zsh b/highlighters/main/test-data/path_prefix2.zsh index a1974eb..bd6990c 100644 --- a/highlighters/main/test-data/path_prefix2.zsh +++ b/highlighters/main/test-data/path_prefix2.zsh @@ -35,5 +35,5 @@ BUFFER='ls /bin/s' WIDGET=accept-line expected_region_highlight=( - "4 9 $ZSH_HIGHLIGHT_STYLES[default]" # /bin/s + "4 9 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # /bin/s ) diff --git a/highlighters/main/test-data/precommand.zsh b/highlighters/main/test-data/precommand.zsh index 156b72d..3ec941a 100644 --- a/highlighters/main/test-data/precommand.zsh +++ b/highlighters/main/test-data/precommand.zsh @@ -31,7 +31,7 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight BUFFER=': command zzzzzz' expected_region_highlight=( - "1 1 $ZSH_HIGHLIGHT_STYLES[command]" # ls - "3 9 $ZSH_HIGHLIGHT_STYLES[default]" # not precommand - "11 16 $ZSH_HIGHLIGHT_STYLES[default]" # not unknown-token (since 'zzzzzz' is not a command) + "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "3 9 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # not precommand + "11 16 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # not unknown-token (since 'zzzzzz' is not a command) ) diff --git a/highlighters/main/test-data/prefix-redirection.zsh b/highlighters/main/test-data/prefix-redirection.zsh index 0eddf0f..4681584 100644 --- a/highlighters/main/test-data/prefix-redirection.zsh +++ b/highlighters/main/test-data/prefix-redirection.zsh @@ -30,10 +30,10 @@ BUFFER='>/tmp >/tmp sudo echo >/tmp foo' expected_region_highlight=( - "2 5 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp - "8 11 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp - "13 16 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo - "18 21 $ZSH_HIGHLIGHT_STYLES[builtin]" # echo - "24 27 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp - "29 31 $ZSH_HIGHLIGHT_STYLES[default]" # foo + "2 5 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp + "8 11 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp + "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo + "18 21 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo + "24 27 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp + "29 31 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # foo ) diff --git a/highlighters/main/test-data/redirection.zsh b/highlighters/main/test-data/redirection.zsh index 7515352..c1a2049 100644 --- a/highlighters/main/test-data/redirection.zsh +++ b/highlighters/main/test-data/redirection.zsh @@ -32,6 +32,6 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight BUFFER='<<>&!bar' expected_region_highlight=( - "1 3 $ZSH_HIGHLIGHT_STYLES[redirection]" # <<< - "13 16 $ZSH_HIGHLIGHT_STYLES[redirection]" # >>&! + "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # <<< + "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # >>&! ) diff --git a/highlighters/main/test-data/reserved-word.zsh b/highlighters/main/test-data/reserved-word.zsh index 2f62103..50cd72b 100644 --- a/highlighters/main/test-data/reserved-word.zsh +++ b/highlighters/main/test-data/reserved-word.zsh @@ -31,8 +31,8 @@ ZSH_HIGHLIGHT_STYLES[reserved-word]=$unused_highlight BUFFER='repeat "1" do done' expected_region_highlight=( - "1 6 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # repeat - "8 10 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "1" - "12 13 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # do - "15 18 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # done + "1 6 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # repeat + "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "1" + "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # do + "15 18 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # done ) diff --git a/highlighters/main/test-data/simple-command.zsh b/highlighters/main/test-data/simple-command.zsh index 51dd9a9..e7a5378 100644 --- a/highlighters/main/test-data/simple-command.zsh +++ b/highlighters/main/test-data/simple-command.zsh @@ -30,5 +30,5 @@ BUFFER='ls' expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls ) diff --git a/highlighters/main/test-data/simple-redirection.zsh b/highlighters/main/test-data/simple-redirection.zsh index 191c67e..11e5ec7 100644 --- a/highlighters/main/test-data/simple-redirection.zsh +++ b/highlighters/main/test-data/simple-redirection.zsh @@ -30,9 +30,9 @@ BUFFER='ps aux | grep java' expected_region_highlight=( - "1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ps - "4 6 $ZSH_HIGHLIGHT_STYLES[default]" # aux - "8 8 $ZSH_HIGHLIGHT_STYLES[default]" # | - "10 13 $ZSH_HIGHLIGHT_STYLES[command]" # grep - "15 18 $ZSH_HIGHLIGHT_STYLES[default]" # java + "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ps + "4 6 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # aux + "8 8 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # | + "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # grep + "15 18 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # java ) diff --git a/highlighters/main/test-data/subshell.zsh b/highlighters/main/test-data/subshell.zsh index 3e98476..c02de9d 100644 --- a/highlighters/main/test-data/subshell.zsh +++ b/highlighters/main/test-data/subshell.zsh @@ -30,12 +30,12 @@ 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[reserved-word]" # ) - "40 40 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # { - "42 44 $ZSH_HIGHLIGHT_STYLES[command]" # cat - "46 46 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # } + "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # tar + "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ( + "15 16 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # cd + "27 29 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # tar + "36 36 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ) + "40 40 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # { + "42 44 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # cat + "46 46 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # } ) diff --git a/highlighters/main/test-data/sudo-command.zsh b/highlighters/main/test-data/sudo-command.zsh index ec1ccff..0fbbb6f 100644 --- a/highlighters/main/test-data/sudo-command.zsh +++ b/highlighters/main/test-data/sudo-command.zsh @@ -35,13 +35,13 @@ ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=$unused_highlight BUFFER='sudo -C3 -u otheruser -i ls /; sudo ; sudo -u ;' expected_region_highlight=( - "1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo - "6 8 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -C3 - "10 11 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u - "13 21 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser - "23 24 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -i - "26 27 $ZSH_HIGHLIGHT_STYLES[command]" # ls - "29 29 $ZSH_HIGHLIGHT_STYLES[path]" # / - "37 37 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # ;, error because empty command - "47 47 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # ;, error because incomplete command + "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo + "6 8 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -C3 + "10 11 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u + "13 21 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser + "23 24 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -i + "26 27 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "29 29 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # / + "37 37 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ;, error because empty command + "47 47 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ;, error because incomplete command ) diff --git a/highlighters/main/test-data/sudo-comment.zsh b/highlighters/main/test-data/sudo-comment.zsh index 8a70ae3..bb26fe7 100644 --- a/highlighters/main/test-data/sudo-comment.zsh +++ b/highlighters/main/test-data/sudo-comment.zsh @@ -32,7 +32,7 @@ setopt interactive_comments BUFFER='sudo -u # comment' expected_region_highlight=( - "1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo - "6 7 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u - "9 17 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # "# comment" - error because argument missed + "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo + "6 7 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u + "9 17 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # "# comment" - error because argument missed ) diff --git a/highlighters/main/test-data/sudo-redirection.zsh b/highlighters/main/test-data/sudo-redirection.zsh index c99e174..8ef5f9f 100644 --- a/highlighters/main/test-data/sudo-redirection.zsh +++ b/highlighters/main/test-data/sudo-redirection.zsh @@ -31,17 +31,17 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight BUFFER='sudo -u >/tmp otheruser ls; sudo ls; sudo -i ls' expected_region_highlight=( - "1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo - "6 7 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u - "9 9 $ZSH_HIGHLIGHT_STYLES[redirection]" # > - "10 13 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp - "15 23 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser - "25 26 $ZSH_HIGHLIGHT_STYLES[command]" # ls - "27 27 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; - "29 32 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo - "34 35 $ZSH_HIGHLIGHT_STYLES[command]" # ls - "36 36 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; - "38 41 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo - "43 44 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -i - "46 47 $ZSH_HIGHLIGHT_STYLES[command]" # ls + "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo + "6 7 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u + "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # > + "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp + "15 23 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser + "25 26 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "27 27 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; + "29 32 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo + "34 35 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "36 36 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; + "38 41 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo + "43 44 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -i + "46 47 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls ) diff --git a/highlighters/main/test-data/sudo-redirection2.zsh b/highlighters/main/test-data/sudo-redirection2.zsh index 7242f3b..810ff42 100644 --- a/highlighters/main/test-data/sudo-redirection2.zsh +++ b/highlighters/main/test-data/sudo-redirection2.zsh @@ -31,10 +31,10 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight BUFFER='sudo >/tmp -u otheruser ls' expected_region_highlight=( - "1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo - "6 6 $ZSH_HIGHLIGHT_STYLES[redirection]" # > - "7 10 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp - "12 13 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u - "15 23 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser - "25 26 $ZSH_HIGHLIGHT_STYLES[command]" # ls + "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo + "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # > + "7 10 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp + "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u + "15 23 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser + "25 26 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls ) diff --git a/highlighters/main/test-data/sudo-redirection3.zsh b/highlighters/main/test-data/sudo-redirection3.zsh index 1e9b215..2ac24e3 100644 --- a/highlighters/main/test-data/sudo-redirection3.zsh +++ b/highlighters/main/test-data/sudo-redirection3.zsh @@ -31,10 +31,10 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight BUFFER='sudo 2>./. -u otheruser ls' expected_region_highlight=( - "1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo - "6 7 $ZSH_HIGHLIGHT_STYLES[redirection]" # 2> - "8 10 $ZSH_HIGHLIGHT_STYLES[path]" # ./. # a 3-character path, for alignment with sudo-redirection2.zsh - "12 13 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u - "15 23 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser - "25 26 $ZSH_HIGHLIGHT_STYLES[command]" # ls + "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo + "6 7 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # 2> + "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # ./. # a 3-character path, for alignment with sudo-redirection2.zsh + "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u + "15 23 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser + "25 26 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls ) diff --git a/highlighters/main/test-data/tilde-command-word.zsh b/highlighters/main/test-data/tilde-command-word.zsh index e66db8e..cb9c87b 100644 --- a/highlighters/main/test-data/tilde-command-word.zsh +++ b/highlighters/main/test-data/tilde-command-word.zsh @@ -32,6 +32,6 @@ hash -d D=/usr/bin BUFFER='~D/env foo' expected_region_highlight=( - "1 6 $ZSH_HIGHLIGHT_STYLES[command]" # ~D/env [= /usr/bin/env] - "8 10 $ZSH_HIGHLIGHT_STYLES[default]" # foo + "1 6 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ~D/env [= /usr/bin/env]} + "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # foo ) diff --git a/highlighters/main/test-data/unbackslash.zsh b/highlighters/main/test-data/unbackslash.zsh index b96c055..fcdaf44 100644 --- a/highlighters/main/test-data/unbackslash.zsh +++ b/highlighters/main/test-data/unbackslash.zsh @@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[command]=$unused_highlight BUFFER='\sh' expected_region_highlight=( - "1 3 $ZSH_HIGHLIGHT_STYLES[command]" # \sh (runs 'sh', bypassing aliases) + "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # \sh (runs 'sh', bypassing aliases) ) diff --git a/highlighters/main/test-data/unknown-command.zsh b/highlighters/main/test-data/unknown-command.zsh index 9b9e8d3..4fd8663 100644 --- a/highlighters/main/test-data/unknown-command.zsh +++ b/highlighters/main/test-data/unknown-command.zsh @@ -30,5 +30,5 @@ BUFFER='azertyuiop' expected_region_highlight=( - "1 10 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # azertyuiop + "1 10 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # azertyuiop ) diff --git a/highlighters/main/test-data/vanilla-newline.zsh b/highlighters/main/test-data/vanilla-newline.zsh index 7fa9ba2..4f270a8 100644 --- a/highlighters/main/test-data/vanilla-newline.zsh +++ b/highlighters/main/test-data/vanilla-newline.zsh @@ -31,9 +31,9 @@ PREBUFFER=$'echo foo; echo bar\n\n\n' BUFFER=' echo baz; echo qux' expected_region_highlight=( - "2 5 $ZSH_HIGHLIGHT_STYLES[builtin]" # echo - "7 9 $ZSH_HIGHLIGHT_STYLES[default]" # baz - "10 10 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # semicolon - "12 15 $ZSH_HIGHLIGHT_STYLES[builtin]" # echo - "17 19 $ZSH_HIGHLIGHT_STYLES[default]" # qux + "2 5 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo + "7 9 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # baz + "10 10 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # semicolon + "12 15 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo + "17 19 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # qux ) diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index b59997d..9254ba4 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -103,8 +103,8 @@ run_test_internal() { highlight_zone=${(z)expected_region_highlight[$i]} [[ -n "$highlight_zone[4]" ]] && todo=" # TODO $highlight_zone[4]" for j in {$highlight_zone[1]..$highlight_zone[2]}; do - if [[ "$observed_result[$j]" != "$highlight_zone[3]" ]]; then - echo "not ok $i ${(qqq)BUFFER[$highlight_zone[1],$highlight_zone[2]]} [$highlight_zone[1],$highlight_zone[2]]: expected ${(qqq)highlight_zone[3]}, observed ${(qqq)observed_result[$j]}.$todo" + if [[ "$observed_result[$j]" != "${(Q)highlight_zone[3]}" ]]; then + echo "not ok $i ${(qqq)BUFFER[$highlight_zone[1],$highlight_zone[2]]} [$highlight_zone[1],$highlight_zone[2]]: expected ${(Q)highlight_zone[3]}, observed ${(qqq)observed_result[$j]}.$todo" continue 2 fi done