'main': Don't highlight bare '$foo' as a filename, as it's a parameter expansion.
Fixes #474.
This commit is contained in:
parent
382be9096d
commit
03692831ad
@ -823,7 +823,9 @@ _zsh_highlight_main_highlighter_highlight_argument()
|
|||||||
highlights+=($reply)
|
highlights+=($reply)
|
||||||
;;
|
;;
|
||||||
'$')
|
'$')
|
||||||
|
path_eligible=0
|
||||||
if [[ $arg[i+1] == "'" ]]; then
|
if [[ $arg[i+1] == "'" ]]; then
|
||||||
|
path_eligible=1
|
||||||
_zsh_highlight_main_highlighter_highlight_dollar_quote $i
|
_zsh_highlight_main_highlighter_highlight_dollar_quote $i
|
||||||
(( i = REPLY ))
|
(( i = REPLY ))
|
||||||
highlights+=($reply)
|
highlights+=($reply)
|
||||||
|
@ -33,6 +33,6 @@ BUFFER=': $foo \$foo'
|
|||||||
|
|
||||||
expected_region_highlight=(
|
expected_region_highlight=(
|
||||||
'1 1 builtin' # :
|
'1 1 builtin' # :
|
||||||
'3 6 default "issue #474"' # $foo - if we add a "unquoted parameter expansion" style then this expectation should change
|
'3 6 default' # $foo - if we add a "unquoted parameter expansion" style then this expectation should change
|
||||||
'8 12 path' # \$foo
|
'8 12 path' # \$foo
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user