summaryrefslogtreecommitdiff
path: root/Functions/Zle/bracketed-paste-magic
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-10-21 14:47:41 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-10-21 14:47:41 -0700
commitb947789d7c7a9e01880512dff1f27198f4707e50 (patch)
tree0f6c5ba7821a002ee8a51b3b56dda461b884408f /Functions/Zle/bracketed-paste-magic
parent98875bcb05d552cc59b300e33fe9000d295b1ffe (diff)
downloadzsh-b947789d7c7a9e01880512dff1f27198f4707e50.tar.gz
zsh-b947789d7c7a9e01880512dff1f27198f4707e50.zip
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.
Diffstat (limited to 'Functions/Zle/bracketed-paste-magic')
-rw-r--r--Functions/Zle/bracketed-paste-magic11
1 files changed, 7 insertions, 4 deletions
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