mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
'brackets': Fix for one-based indexing
Use correct indexing also for cursor-matchingbracket.
Fixup for 95d82568d8
This commit is contained in:
parent
2176692704
commit
5fe8fd8bdc
2 changed files with 41 additions and 2 deletions
|
|
@ -86,10 +86,10 @@ _zsh_highlight_brackets_highlighter()
|
|||
done
|
||||
|
||||
# If cursor is on a bracket, then highlight corresponding bracket, if any
|
||||
pos=$CURSOR
|
||||
pos=$((CURSOR + 1))
|
||||
if [[ -n $levelpos[$pos] ]] && [[ -n $matching[$pos] ]]; then
|
||||
local -i otherpos=$matching[$pos]
|
||||
_zsh_highlight_add_highlight $otherpos $((otherpos + 1)) cursor-matchingbracket
|
||||
_zsh_highlight_add_highlight $((otherpos - 1)) $otherpos cursor-matchingbracket
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue