Преглед на файлове

'main': Fix the last commit's bug concerning parameter elision not happening in redirects in command position.

pull/709/merge
Daniel Shahaf преди 4 години
родител
ревизия
ea3ae74164
променени са 2 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. +1
    -1
      highlighters/main/main-highlighter.zsh
  2. +3
    -3
      highlighters/main/test-data/redirection-inhibits-elision.zsh

+ 1
- 1
highlighters/main/main-highlighter.zsh Целия файл

@ -750,7 +750,7 @@ _zsh_highlight_main_highlighter_highlight_list()
# parameters that refer to commands, functions, and builtins.
() {
local -a words; words=( "${reply[@]}" )
if (( $#words == 0 )); then
if (( $#words == 0 )) && (( ! in_redirection )); then
# Parameter elision is happening
(( ++in_redirection ))
_zsh_highlight_main_add_region_highlight $start_pos $end_pos comment

+ 3
- 3
highlighters/main/test-data/redirection-inhibits-elision.zsh Целия файл

@ -32,7 +32,7 @@ BUFFER=$'<$foo cat cat'
expected_region_highlight=(
'1 1 redirection' # <
'2 5 default "fixed in the next commit"' # $foo
'7 9 command "fixed in the next commit"' # cat
'11 13 default "fixed in the next commit"' # cat
'2 5 default' # $foo
'7 9 command' # cat
'11 13 default' # cat
)

Зареждане…
Отказ
Запис