'main': Fix the last commit's issue concerning parameter expansion at command word.

This commit is contained in:
Daniel Shahaf
2016-07-28 22:41:23 +00:00
committed by Matthew Martin
parent 76d61360a7
commit bf055f7df2
3 changed files with 26 additions and 19 deletions

View File

@@ -29,6 +29,8 @@
local x=/usr/bin/env
local y=sudo
sudo(){}
BUFFER='$x "argument"; $y'
expected_region_highlight=(
@@ -36,5 +38,5 @@ expected_region_highlight=(
"4 13 default" # "argument"
"4 13 double-quoted-argument" # "argument"
"14 14 commandseparator" # ;
"16 17 precommand 'parameter expansion precedes precommand recognition'" # $y (sudo)
"16 17 precommand" # $y (sudo)
)

View File

@@ -29,10 +29,12 @@
# «/usr» at this point would be highlighted as path_prefix; so should
# a parameter that expands to an equivalent string be highlighted.
#
# More complicated parameter substitutions aren't eval'd; issue #328.
BUFFER='$PWD; ${PWD}'
expected_region_highlight=(
"1 4 unknown-token" # $PWD - not eval'd; issue #328
"1 4 path" # $PWD
"5 5 commandseparator" # ;
"7 12 unknown-token" # ${PWD}
)