diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2015-09-11 21:51:49 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2015-09-11 21:51:49 +0200 |
commit | 7534dfa8848251305ad2914c338f232050f6a500 (patch) | |
tree | e693cdc8e3eaa157574c10de89a94a3547faa78e /Functions/Zle | |
parent | 63deeaba7e4ae09b81d933985152c4240ae08d25 (diff) | |
parent | 68405f31a043bdd5bf338eb06688ed3e1f740937 (diff) | |
download | zsh-7534dfa8848251305ad2914c338f232050f6a500.tar.gz zsh-7534dfa8848251305ad2914c338f232050f6a500.zip |
Merge tag 'zsh-5.1.1' into debian
Diffstat (limited to 'Functions/Zle')
-rw-r--r-- | Functions/Zle/bracketed-paste-magic | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Functions/Zle/bracketed-paste-magic b/Functions/Zle/bracketed-paste-magic index 49f4b6620..464c6b339 100644 --- a/Functions/Zle/bracketed-paste-magic +++ b/Functions/Zle/bracketed-paste-magic @@ -164,17 +164,25 @@ 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 - PASTED=${PASTED#$KEYS} - if [[ $KEYS = ${(~j:|:)${(b)bpm_inactive}} ]]; then - zle .self-insert-unmeta + 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 else case $REPLY in (${~bpm_active}) function () { emulate -L $bpm_emulate; set -$bpm_opts zle $REPLY };; - (*) zle .self-insert-unmeta;; + (*) LBUFFER+=$mbchar; esac fi done |