Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim trailing whitespace #832

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ indent_style = space
tab_width = 8
indent_size = 8
indent_style = tab

1 change: 0 additions & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,3 @@ IRC channel
-----------

We're on #zsh-syntax-highlighting on Libera.Chat.

2 changes: 0 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ to issue #418.

[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



## Other changes:
Expand Down Expand Up @@ -881,4 +880,3 @@ in this area.
# Version 0.2.1

(Start of changelog.)

2 changes: 1 addition & 1 deletion docs/highlighters.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ To create your own `acme` highlighter:

* 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_paint`
were named
Expand Down
2 changes: 1 addition & 1 deletion highlighters/brackets/brackets-highlighter.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ _zsh_highlight_highlighter_brackets_paint()
fi
}

# Helper function to differentiate type
# Helper function to differentiate type
_zsh_highlight_brackets_match()
{
case $BUFFER[$1] in
Expand Down
2 changes: 1 addition & 1 deletion highlighters/cursor/cursor-highlighter.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ _zsh_highlight_highlighter_cursor_predicate()
_zsh_highlight_highlighter_cursor_paint()
{
[[ $WIDGET == zle-line-finish ]] && return

_zsh_highlight_add_highlight $CURSOR $(( $CURSOR + 1 )) cursor
}
14 changes: 7 additions & 7 deletions highlighters/main/main-highlighter.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,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.
Expand All @@ -458,7 +458,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
Expand Down Expand Up @@ -781,7 +781,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] ]]
Expand Down Expand Up @@ -809,7 +809,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 ]]
Expand Down Expand Up @@ -867,7 +867,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;
Expand All @@ -876,7 +876,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

Expand Down Expand Up @@ -1031,7 +1031,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:'
Expand Down
4 changes: 2 additions & 2 deletions highlighters/main/test-data/path-dollared-word.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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" # ;
Expand Down
1 change: 0 additions & 1 deletion highlighters/main/test-data/path-tilde-home2.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ expected_region_highlight=(
"1 2 command" # ls
"4 4 default" # ~
)

4 changes: 2 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
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
with the provided string as the reason.

Expand Down
2 changes: 1 addition & 1 deletion tests/edit-failed-tests
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
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}}}}" )
() {
() {
> "$2" perl -nE '$highlighter = $1 if /^Running test (\S*)/; say "highlighters/${highlighter}/test-data/$1.zsh" if /^## (\S*)/' "$1"
>>"$2" echo ""
>>"$2" cat <"$1"
Expand Down
2 changes: 1 addition & 1 deletion tests/generate.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ print 'expected_region_highlight=('
local i
local PREBUFFER
local BUFFER

PREBUFFER=""
BUFFER="$buffer"
region_highlight=()
Expand Down
2 changes: 1 addition & 1 deletion zsh-syntax-highlighting.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ _zsh_highlight_call_widget()
# 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.
#
#
# 2. If zsh has the memo= feature, which is required for interoperability reasons.
# See issues #579 and #735, and the issues referenced from them.
#
Expand Down