*: Remove trailing whitespace

This commit is contained in:
a1346054 2021-08-20 11:27:21 +00:00
parent caa749d030
commit 5d1d416dbf
13 changed files with 17 additions and 22 deletions

View File

@ -12,4 +12,3 @@ indent_style = space
tab_width = 8 tab_width = 8
indent_size = 8 indent_size = 8
indent_style = tab indent_style = tab

View File

@ -96,4 +96,3 @@ IRC channel
----------- -----------
We're on #zsh-syntax-highlighting on Libera.Chat. We're on #zsh-syntax-highlighting on Libera.Chat.

View File

@ -91,7 +91,6 @@ to issue #418.
[zshcompsys-Standard-Styles]: https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Standard-Styles [zshcompsys-Standard-Styles]: https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Standard-Styles
[zshcompsys-Standard-Styles-format]: https://zsh.sourceforge.io/Doc/Release/Completion-System.html#index-format_002c-completion-style [zshcompsys-Standard-Styles-format]: https://zsh.sourceforge.io/Doc/Release/Completion-System.html#index-format_002c-completion-style
## Other changes: ## Other changes:
@ -881,4 +880,3 @@ in this area.
# Version 0.2.1 # Version 0.2.1
(Start of changelog.) (Start of changelog.)

View File

@ -115,7 +115,7 @@ To create your own `acme` highlighter:
* Name your own functions and global variables `_zsh_highlight_acme_*`. * Name your own functions and global variables `_zsh_highlight_acme_*`.
- In zsh-syntax-highlighting 0.4.0 and earlier, the entrypoints - In zsh-syntax-highlighting 0.4.0 and earlier, the entrypoints
`_zsh_highlight_highlighter_acme_predicate` and `_zsh_highlight_highlighter_acme_predicate` and
`_zsh_highlight_highlighter_acme_paint` `_zsh_highlight_highlighter_acme_paint`
were named were named

View File

@ -95,7 +95,7 @@ _zsh_highlight_highlighter_brackets_paint()
fi fi
} }
# Helper function to differentiate type # Helper function to differentiate type
_zsh_highlight_brackets_match() _zsh_highlight_brackets_match()
{ {
case $BUFFER[$1] in case $BUFFER[$1] in

View File

@ -42,6 +42,6 @@ _zsh_highlight_highlighter_cursor_predicate()
_zsh_highlight_highlighter_cursor_paint() _zsh_highlight_highlighter_cursor_paint()
{ {
[[ $WIDGET == zle-line-finish ]] && return [[ $WIDGET == zle-line-finish ]] && return
_zsh_highlight_add_highlight $CURSOR $(( $CURSOR + 1 )) cursor _zsh_highlight_add_highlight $CURSOR $(( $CURSOR + 1 )) cursor
} }

View File

@ -432,7 +432,7 @@ _zsh_highlight_highlighter_main_paint()
} }
# Try to expand $1, if it's possible to do so safely. # Try to expand $1, if it's possible to do so safely.
# #
# Uses two parameters from the caller: $parameter_name_pattern and $res. # Uses two parameters from the caller: $parameter_name_pattern and $res.
# #
# If expansion was done, set $reply to the expansion and return true. # If expansion was done, set $reply to the expansion and return true.
@ -458,7 +458,7 @@ _zsh_highlight_main_highlighter__try_expand_parameter()
else else
parameter_name=${arg:1} parameter_name=${arg:1}
fi fi
if [[ $res == none ]] && if [[ $res == none ]] &&
[[ ${parameter_name} =~ ^${~parameter_name_pattern}$ ]] && [[ ${parameter_name} =~ ^${~parameter_name_pattern}$ ]] &&
[[ ${(tP)MATCH} != *special* ]] [[ ${(tP)MATCH} != *special* ]]
then then
@ -781,7 +781,7 @@ _zsh_highlight_main_highlighter_highlight_list()
if (( ! in_redirection )); then if (( ! in_redirection )); then
if [[ $this_word == *':sudo_opt:'* ]]; then if [[ $this_word == *':sudo_opt:'* ]]; then
if [[ -n $flags_with_argument ]] && if [[ -n $flags_with_argument ]] &&
{ {
# Trenary # Trenary
if [[ -n $flags_sans_argument ]] if [[ -n $flags_sans_argument ]]
then [[ $arg == '-'[$flags_sans_argument]#[$flags_with_argument] ]] then [[ $arg == '-'[$flags_sans_argument]#[$flags_with_argument] ]]
@ -809,7 +809,7 @@ _zsh_highlight_main_highlighter_highlight_list()
this_word=':sudo_opt:' this_word=':sudo_opt:'
next_word+=':start:' next_word+=':start:'
next_word+=':sudo_opt:' next_word+=':sudo_opt:'
elif [[ -n $flags_solo ]] && elif [[ -n $flags_solo ]] &&
{ {
# Trenary # Trenary
if [[ -n $flags_sans_argument ]] if [[ -n $flags_sans_argument ]]
@ -867,7 +867,7 @@ _zsh_highlight_main_highlighter_highlight_list()
elif [[ $this_word == *':start:'* ]] && [[ $arg == $'\n' ]]; then elif [[ $this_word == *':start:'* ]] && [[ $arg == $'\n' ]]; then
style=commandseparator style=commandseparator
elif [[ $this_word == *':start:'* ]] && [[ $arg == ';' ]] && (( $#in_alias )); then elif [[ $this_word == *':start:'* ]] && [[ $arg == ';' ]] && (( $#in_alias )); then
style=commandseparator style=commandseparator
else else
# Empty commands (semicolon follows nothing) are valid syntax. # Empty commands (semicolon follows nothing) are valid syntax.
# However, in interactive use they are likely to be erroneous; # However, in interactive use they are likely to be erroneous;
@ -876,7 +876,7 @@ _zsh_highlight_main_highlighter_highlight_list()
# Alias definitions are exempted from this check to allow multiline aliases # Alias definitions are exempted from this check to allow multiline aliases
# with explicit (redundant) semicolons: «alias foo=$'bar;\nbaz'» (issue #677). # 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 style=unknown-token
fi fi
@ -1031,7 +1031,7 @@ _zsh_highlight_main_highlighter_highlight_list()
else else
# assignment to a scalar parameter. # assignment to a scalar parameter.
# (For array assignments, the command doesn't start until the ")" token.) # (For array assignments, the command doesn't start until the ")" token.)
# #
# Discard :start_of_pipeline:, if present, as '!' is not valid # Discard :start_of_pipeline:, if present, as '!' is not valid
# after assignments. # after assignments.
next_word+=':start:' next_word+=':start:'

View File

@ -34,9 +34,9 @@ else
touch kappa.exe touch kappa.exe
chmod +x kappa.exe chmod +x kappa.exe
cd kappa cd kappa
BUFFER='$PWD.exe; ${PWD}.exe' BUFFER='$PWD.exe; ${PWD}.exe'
expected_region_highlight=( expected_region_highlight=(
"1 8 unknown-token" # $PWD.exe - not eval'd; issue #328 "1 8 unknown-token" # $PWD.exe - not eval'd; issue #328
"9 9 commandseparator" # ; "9 9 commandseparator" # ;

View File

@ -34,4 +34,3 @@ expected_region_highlight=(
"1 2 command" # ls "1 2 command" # ls
"4 4 default" # ~ "4 4 default" # ~
) )

View File

@ -20,11 +20,11 @@ that is, `$i` and `$j` specify a range, 1-indexed, inclusive of both endpoints.
If `$todo` exists, the test point is marked as TODO (the failure of that test If `$todo` exists, the test point is marked as TODO (the failure of that test
point will not fail the test), and `$todo` is used as the explanation. point will not fail the test), and `$todo` is used as the explanation.
2. 2.
If a test sets `$skip_test` to a non-empty string, the test will be skipped If a test sets `$skip_test` to a non-empty string, the test will be skipped
with the provided string as the reason. with the provided string as the reason.
3. 3.
If a test sets `$fail_test` to a non-empty string, the test will be skipped If a test sets `$fail_test` to a non-empty string, the test will be skipped
with the provided string as the reason. with the provided string as the reason.

View File

@ -31,7 +31,7 @@
type perl sponge >/dev/null || { print -ru2 -- "$0: This script requires perl(1) and sponge(1) [from moreutils]"; exit 1; } type perl sponge >/dev/null || { print -ru2 -- "$0: This script requires perl(1) and sponge(1) [from moreutils]"; exit 1; }
local editor=( "${(@Q)${(z)${VISUAL:-${EDITOR:-vi}}}}" ) local editor=( "${(@Q)${(z)${VISUAL:-${EDITOR:-vi}}}}" )
() { () {
> "$2" perl -nE '$highlighter = $1 if /^Running test (\S*)/; say "highlighters/${highlighter}/test-data/$1.zsh" if /^## (\S*)/' "$1" > "$2" perl -nE '$highlighter = $1 if /^Running test (\S*)/; say "highlighters/${highlighter}/test-data/$1.zsh" if /^## (\S*)/' "$1"
>>"$2" echo "" >>"$2" echo ""
>>"$2" cat <"$1" >>"$2" cat <"$1"

View File

@ -87,7 +87,7 @@ print 'expected_region_highlight=('
local i local i
local PREBUFFER local PREBUFFER
local BUFFER local BUFFER
PREBUFFER="" PREBUFFER=""
BUFFER="$buffer" BUFFER="$buffer"
region_highlight=() region_highlight=()

View File

@ -408,7 +408,7 @@ _zsh_highlight_call_widget()
# We use the new codepath under two conditions: # We use the new codepath under two conditions:
# #
# 1. If it's available, which we check by testing for add-zle-hook-widget's availability. # 1. If it's available, which we check by testing for add-zle-hook-widget's availability.
# #
# 2. If zsh has the memo= feature, which is required for interoperability reasons. # 2. If zsh has the memo= feature, which is required for interoperability reasons.
# See issues #579 and #735, and the issues referenced from them. # See issues #579 and #735, and the issues referenced from them.
# #