1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-28 15:01:21 +02:00

43779 (tweaked): add parentheses to fix expression with cprecedences option set

This commit is contained in:
Joey Pabalinas 2018-11-06 13:34:10 -10:00 committed by Oliver Kiddle
parent 5a70701788
commit fc3826190a
2 changed files with 5 additions and 2 deletions

@ -1,5 +1,8 @@
2018-11-08 Oliver Kiddle <okiddle@yahoo.co.uk>
* 43779 (tweaked): Joey Pabalinas: Functions/Zle/select-bracketed:
add parentheses to fix expression with cprecedences option set
* 43805: Src/Modules/nearcolor.c, Src/prompt.c: make nearcolor
module use the default colour rather than black as a fallback

@ -17,8 +17,8 @@ setopt localoptions noksharrays
local style=${${1:-$KEYS}[1]} matching="(){}[]<>bbBB"
local -i find=${NUMERIC:-1} idx=${matching[(I)[${${1:-$KEYS}[2]}]]}%9
(( idx )) || return 1 # no corresponding closing bracket
local lmatch=${matching[1 + (idx-1) & ~1]}
local rmatch=${matching[1 + (idx-1) | 1]}
local lmatch=${matching[1 + ((idx-1) & ~1)]}
local rmatch=${matching[1 + ((idx-1) | 1)]}
local -i start=CURSOR+1 end=CURSOR+1 rfind=find
[[ $BUFFER[start] = "$rmatch" ]] && (( start--, end-- ))