summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Functions/Zle/bracketed-paste-magic11
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 <schaefer@zsh.org>
+
+ * 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 <d.s@daniel.shahaf.name>
* 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