From 5d1d416dbf2048f0922e7d6284da7f320fb544a8 Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Fri, 20 Aug 2021 11:27:21 +0000 Subject: [PATCH] *: Remove trailing whitespace --- .editorconfig | 1 - HACKING.md | 1 - changelog.md | 2 -- docs/highlighters.md | 2 +- highlighters/brackets/brackets-highlighter.zsh | 2 +- highlighters/cursor/cursor-highlighter.zsh | 2 +- highlighters/main/main-highlighter.zsh | 14 +++++++------- highlighters/main/test-data/path-dollared-word.zsh | 4 ++-- highlighters/main/test-data/path-tilde-home2.zsh | 1 - tests/README.md | 4 ++-- tests/edit-failed-tests | 2 +- tests/generate.zsh | 2 +- zsh-syntax-highlighting.zsh | 2 +- 13 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.editorconfig b/.editorconfig index cda541d..82be1d4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,4 +12,3 @@ indent_style = space tab_width = 8 indent_size = 8 indent_style = tab - diff --git a/HACKING.md b/HACKING.md index ddd39a4..6eda295 100644 --- a/HACKING.md +++ b/HACKING.md @@ -96,4 +96,3 @@ IRC channel ----------- We're on #zsh-syntax-highlighting on Libera.Chat. - diff --git a/changelog.md b/changelog.md index 861fea5..0dca21e 100644 --- a/changelog.md +++ b/changelog.md @@ -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: @@ -881,4 +880,3 @@ in this area. # Version 0.2.1 (Start of changelog.) - diff --git a/docs/highlighters.md b/docs/highlighters.md index 3a289ca..6cfe935 100644 --- a/docs/highlighters.md +++ b/docs/highlighters.md @@ -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 diff --git a/highlighters/brackets/brackets-highlighter.zsh b/highlighters/brackets/brackets-highlighter.zsh index bc388fd..82ce13d 100644 --- a/highlighters/brackets/brackets-highlighter.zsh +++ b/highlighters/brackets/brackets-highlighter.zsh @@ -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 diff --git a/highlighters/cursor/cursor-highlighter.zsh b/highlighters/cursor/cursor-highlighter.zsh index 81633a3..3ea24a2 100644 --- a/highlighters/cursor/cursor-highlighter.zsh +++ b/highlighters/cursor/cursor-highlighter.zsh @@ -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 } diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 0bd6dde..b56a751 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -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. @@ -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 @@ -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] ]] @@ -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 ]] @@ -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; @@ -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 @@ -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:' diff --git a/highlighters/main/test-data/path-dollared-word.zsh b/highlighters/main/test-data/path-dollared-word.zsh index 99055da..7ce614e 100644 --- a/highlighters/main/test-data/path-dollared-word.zsh +++ b/highlighters/main/test-data/path-dollared-word.zsh @@ -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" # ; diff --git a/highlighters/main/test-data/path-tilde-home2.zsh b/highlighters/main/test-data/path-tilde-home2.zsh index 3f7b820..78d64ec 100644 --- a/highlighters/main/test-data/path-tilde-home2.zsh +++ b/highlighters/main/test-data/path-tilde-home2.zsh @@ -34,4 +34,3 @@ expected_region_highlight=( "1 2 command" # ls "4 4 default" # ~ ) - diff --git a/tests/README.md b/tests/README.md index cb3d943..486476e 100644 --- a/tests/README.md +++ b/tests/README.md @@ -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. diff --git a/tests/edit-failed-tests b/tests/edit-failed-tests index e3a7668..26bb97d 100755 --- a/tests/edit-failed-tests +++ b/tests/edit-failed-tests @@ -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" diff --git a/tests/generate.zsh b/tests/generate.zsh index 5696020..625bdc2 100755 --- a/tests/generate.zsh +++ b/tests/generate.zsh @@ -87,7 +87,7 @@ print 'expected_region_highlight=(' local i local PREBUFFER local BUFFER - + PREBUFFER="" BUFFER="$buffer" region_highlight=() diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index bec0189..e48ce60 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -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. #