1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 18:30:55 +01:00

unposted: revert 36483 as multibyte is now handled by "zle .read-command"; adapt to new default behavior of zle_highlight for paste

This commit is contained in:
Barton E. Schaefer 2015-09-12 17:16:43 -07:00
parent 8e77fcb050
commit b957cdd21a
2 changed files with 9 additions and 13 deletions

View file

@ -1,5 +1,9 @@
2015-09-12 Barton E. Schaefer <schaefer@zsh.org>
* unposted: Functions/Zle/bracketed-paste-magic: revert 36483 as
multibyte is now handled by "zle .read-command"; adapt to new
default behavior of zle_highlight for paste
* 36522: Src/Zle/zle_thingy.c: unmetafy the argument of "zle -U"
* 36509: Src/Modules/curses.c: allocate hash table nodes with

View file

@ -164,25 +164,17 @@ bracketed-paste-magic() {
integer bpm_limit=$UNDO_LIMIT_NO bpm_undo=$UNDO_CHANGE_NO
UNDO_LIMIT_NO=$UNDO_CHANGE_NO
local mbchar
integer ismb
while [[ -n $PASTED ]] && zle .read-command; do
mbchar=$KEYS
ismb=0
while [[ $mbchar = [[:INCOMPLETE:]]* ]] && zle .read-command; do
mbchar+=$KEYS
ismb=1
done
PASTED=${PASTED#$mbchar}
if [[ ismb -ne 0 || $mbchar = ${(~j:|:)${(b)bpm_inactive}} ]]; then
LBUFFER+=$mbchar
PASTED=${PASTED#$KEYS}
if [[ $KEYS = ${(~j:|:)${(b)bpm_inactive}} ]]; then
zle .self-insert-unmeta
else
case $REPLY in
(${~bpm_active}) function () {
emulate -L $bpm_emulate; set -$bpm_opts
zle $REPLY
};;
(*) LBUFFER+=$mbchar;
(*) zle .self-insert-unmeta;;
esac
fi
done
@ -221,7 +213,7 @@ bracketed-paste-magic() {
zle .split-undo
# Arrange to display highlighting if necessary
if [[ -n ${(M)zle_highlight:#paste:*} ]]; then
if [[ -z $zle_highlight || -n ${(M)zle_highlight:#paste:*} ]]; then
zle -R
zle .read-command && zle -U - $KEYS
fi