mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
Merge 5d1d416dbf into 5eb677bb0f
This commit is contained in:
commit
23cd0e37ae
13 changed files with 17 additions and 22 deletions
|
|
@ -435,7 +435,7 @@ _zsh_highlight_highlighter_main_paint()
|
|||
}
|
||||
|
||||
# Try to expand $1, if it's possible to do so safely.
|
||||
#
|
||||
#
|
||||
# Uses two parameters from the caller: $parameter_name_pattern and $res.
|
||||
#
|
||||
# If expansion was done, set $reply to the expansion and return true.
|
||||
|
|
@ -461,7 +461,7 @@ _zsh_highlight_main_highlighter__try_expand_parameter()
|
|||
else
|
||||
parameter_name=${arg:1}
|
||||
fi
|
||||
if [[ $res == none ]] &&
|
||||
if [[ $res == none ]] &&
|
||||
[[ ${parameter_name} =~ ^${~parameter_name_pattern}$ ]] &&
|
||||
[[ ${(tP)MATCH} != *special* ]]
|
||||
then
|
||||
|
|
@ -784,7 +784,7 @@ _zsh_highlight_main_highlighter_highlight_list()
|
|||
if (( ! in_redirection )); then
|
||||
if [[ $this_word == *':sudo_opt:'* ]]; then
|
||||
if [[ -n $flags_with_argument ]] &&
|
||||
{
|
||||
{
|
||||
# Trenary
|
||||
if [[ -n $flags_sans_argument ]]
|
||||
then [[ $arg == '-'[$flags_sans_argument]#[$flags_with_argument] ]]
|
||||
|
|
@ -812,7 +812,7 @@ _zsh_highlight_main_highlighter_highlight_list()
|
|||
this_word=':sudo_opt:'
|
||||
next_word+=':start:'
|
||||
next_word+=':sudo_opt:'
|
||||
elif [[ -n $flags_solo ]] &&
|
||||
elif [[ -n $flags_solo ]] &&
|
||||
{
|
||||
# Trenary
|
||||
if [[ -n $flags_sans_argument ]]
|
||||
|
|
@ -870,7 +870,7 @@ _zsh_highlight_main_highlighter_highlight_list()
|
|||
elif [[ $this_word == *':start:'* ]] && [[ $arg == $'\n' ]]; then
|
||||
style=commandseparator
|
||||
elif [[ $this_word == *':start:'* ]] && [[ $arg == ';' ]] && (( $#in_alias )); then
|
||||
style=commandseparator
|
||||
style=commandseparator
|
||||
else
|
||||
# Empty commands (semicolon follows nothing) are valid syntax.
|
||||
# However, in interactive use they are likely to be erroneous;
|
||||
|
|
@ -879,7 +879,7 @@ _zsh_highlight_main_highlighter_highlight_list()
|
|||
# Alias definitions are exempted from this check to allow multiline aliases
|
||||
# with explicit (redundant) semicolons: «alias foo=$'bar;\nbaz'» (issue #677).
|
||||
#
|
||||
# See also #691 about possibly changing the style used here.
|
||||
# See also #691 about possibly changing the style used here.
|
||||
style=unknown-token
|
||||
fi
|
||||
|
||||
|
|
@ -1034,7 +1034,7 @@ _zsh_highlight_main_highlighter_highlight_list()
|
|||
else
|
||||
# assignment to a scalar parameter.
|
||||
# (For array assignments, the command doesn't start until the ")" token.)
|
||||
#
|
||||
#
|
||||
# Discard :start_of_pipeline:, if present, as '!' is not valid
|
||||
# after assignments.
|
||||
next_word+=':start:'
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ else
|
|||
touch kappa.exe
|
||||
chmod +x kappa.exe
|
||||
cd kappa
|
||||
|
||||
|
||||
BUFFER='$PWD.exe; ${PWD}.exe'
|
||||
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 8 unknown-token" # $PWD.exe - not eval'd; issue #328
|
||||
"9 9 commandseparator" # ;
|
||||
|
|
|
|||
|
|
@ -34,4 +34,3 @@ expected_region_highlight=(
|
|||
"1 2 command" # ls
|
||||
"4 4 default" # ~
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue