From b947789d7c7a9e01880512dff1f27198f4707e50 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Wed, 21 Oct 2015 14:47:41 -0700 Subject: 36871: move initial call to "zle .bracketed-paste-magic" to occur earlier in the function Just in case any later initialization might have side-effects. --- ChangeLog | 5 +++++ Functions/Zle/bracketed-paste-magic | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04883a152..22e4b9478 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-21 Barton E. Schaefer + + * 36871: Functions/Zle/bracketed-paste-magic: move initial call + to "zle .bracketed-paste-magic" to occur earlier in the function + 2015-10-20 Daniel Shahaf * 36900: Completion/Unix/Command/_git: _git: stash names diff --git a/Functions/Zle/bracketed-paste-magic b/Functions/Zle/bracketed-paste-magic index cd4a7085b..2368bc315 100644 --- a/Functions/Zle/bracketed-paste-magic +++ b/Functions/Zle/bracketed-paste-magic @@ -116,10 +116,14 @@ quote-paste() { # Now the actual function bracketed-paste-magic() { - # Fast exit in the vi-mode cut-buffer context if [[ "$LASTWIDGET" = *vi-set-buffer ]]; then + # Fast exit in the vi-mode cut-buffer context zle .bracketed-paste return + else + # Capture the pasted text in $PASTED + local PASTED + zle .bracketed-paste PASTED fi # Really necessary to go to this much effort? @@ -127,10 +131,9 @@ bracketed-paste-magic() { emulate -L zsh local -a bpm_hooks bpm_inactive - local PASTED bpm_func bpm_active bpm_keymap=$KEYMAP + local bpm_func bpm_active bpm_keymap=$KEYMAP - # Set PASTED and run the paste-init functions - zle .bracketed-paste PASTED + # Run the paste-init functions if zstyle -a :bracketed-paste-magic paste-init bpm_hooks; then for bpm_func in $bpm_hooks; do if (( $+functions[$bpm_func] )); then -- cgit 1.4.1