Browse Source

Merge 5d1d416dbf into e0165eaa73

pull/832/merge
a1346054 8 months ago
committed by GitHub
parent
commit
5184d35b5f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 17 additions and 22 deletions
  1. +0
    -1
      .editorconfig
  2. +0
    -1
      HACKING.md
  3. +0
    -2
      changelog.md
  4. +1
    -1
      docs/highlighters.md
  5. +1
    -1
      highlighters/brackets/brackets-highlighter.zsh
  6. +1
    -1
      highlighters/cursor/cursor-highlighter.zsh
  7. +7
    -7
      highlighters/main/main-highlighter.zsh
  8. +2
    -2
      highlighters/main/test-data/path-dollared-word.zsh
  9. +0
    -1
      highlighters/main/test-data/path-tilde-home2.zsh
  10. +2
    -2
      tests/README.md
  11. +1
    -1
      tests/edit-failed-tests
  12. +1
    -1
      tests/generate.zsh
  13. +1
    -1
      zsh-syntax-highlighting.zsh

+ 0
- 1
.editorconfig View File

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

+ 0
- 1
HACKING.md View File

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

+ 0
- 2
changelog.md View File

@ -125,7 +125,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:
@ -917,4 +916,3 @@ in this area.
# Version 0.2.1
(Start of changelog.)

+ 1
- 1
docs/highlighters.md View File

@ -113,7 +113,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

+ 1
- 1
highlighters/brackets/brackets-highlighter.zsh View File

@ -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

+ 1
- 1
highlighters/cursor/cursor-highlighter.zsh View File

@ -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
}

+ 7
- 7
highlighters/main/main-highlighter.zsh View File

@ -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:'

+ 2
- 2
highlighters/main/test-data/path-dollared-word.zsh View File

@ -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" # ;

+ 0
- 1
highlighters/main/test-data/path-tilde-home2.zsh View File

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

+ 2
- 2
tests/README.md 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
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.

+ 1
- 1
tests/edit-failed-tests 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; }
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"

+ 1
- 1
tests/generate.zsh View File

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

+ 1
- 1
zsh-syntax-highlighting.zsh View File

@ -397,7 +397,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.
#

Loading…
Cancel
Save