1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00

38749: fixes for case at start of a line and for ksharrays

This commit is contained in:
Oliver Kiddle 2016-06-22 22:15:52 +02:00
parent 7ae2deb437
commit 76f28cc908
3 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2016-06-22 Oliver Kiddle <opk@zsh.org>
* 38749: Functions/Zle/surround, Functions/Zle/select-bracketed:
fixes for case at start of a line and for ksharrays
2016-06-22 Peter Stephenson <p.stephenson@samsung.com>
* unposted: Src/lex.c: remove unused and no longer defined flag

View file

@ -12,6 +12,8 @@
# done
# done
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

View file

@ -69,7 +69,11 @@ case $WIDGET in
before="${(k)matching[(r)[$before:q]]}"
fi
CUTBUFFER="$before$CUTBUFFER$after"
zle .vi-put-after -n 1
if [[ CURSOR -eq 0 || $BUFFER[CURSOR] = $'\n' ]]; then
zle .vi-put-before -n 1
else
zle .vi-put-after -n 1
fi
CUTBUFFER="$save_cut" CURSOR="$save_cur"
;;
esac