summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-09-12 17:16:43 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-09-12 17:16:43 -0700
commitb957cdd21a8997739aba48c3637fc3b9f88b2168 (patch)
tree8b0d0ef1fc43e12243e850e707612d11cbeef8f9
parent8e77fcb050ed09042cc2464f804ac023c0f88b42 (diff)
downloadzsh-b957cdd21a8997739aba48c3637fc3b9f88b2168.tar.gz
zsh-b957cdd21a8997739aba48c3637fc3b9f88b2168.zip
unposted: revert 36483 as multibyte is now handled by "zle .read-command"; adapt to new default behavior of zle_highlight for paste
-rw-r--r--ChangeLog4
-rw-r--r--Functions/Zle/bracketed-paste-magic18
2 files changed, 9 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 1ce47d7f1..53772e565 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/Functions/Zle/bracketed-paste-magic b/Functions/Zle/bracketed-paste-magic
index 464c6b339..cd4a7085b 100644
--- a/Functions/Zle/bracketed-paste-magic
+++ b/Functions/Zle/bracketed-paste-magic
@@ -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