summary refs log tree commit diff
diff options
context:
space:
mode:
-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