summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-07-24 22:33:14 +0200
committerOliver Kiddle <opk@zsh.org>2016-07-24 22:33:14 +0200
commitac05343049e7a092c711a97d616abfd5e85ca58e (patch)
tree3a7abb86efbbdda5125a42e3d717b7485e4ed922 /Functions
parent932ff2b6f8990b027facc93fb23bc1dc0163707e (diff)
downloadzsh-ac05343049e7a092c711a97d616abfd5e85ca58e.tar.gz
zsh-ac05343049e7a092c711a97d616abfd5e85ca58e.tar.xz
zsh-ac05343049e7a092c711a97d616abfd5e85ca58e.zip
38936: fix vi-pipe function for option compatibility
Diffstat (limited to 'Functions')
-rw-r--r--Functions/Zle/vi-pipe11
1 files changed, 8 insertions, 3 deletions
diff --git a/Functions/Zle/vi-pipe b/Functions/Zle/vi-pipe
index 2d2e29587..028f1e1ce 100644
--- a/Functions/Zle/vi-pipe
+++ b/Functions/Zle/vi-pipe
@@ -7,16 +7,21 @@
 #   autoload -Uz vi-pipe
 #   bindkey -a '!' vi-pipe
 
+setopt localoptions noksharrays
+
 autoload -Uz read-from-minibuffer
 local _save_cut="$CUTBUFFER" REPLY
 
-# Use the standard vi-delete to accept a vi motion.
-zle .vi-delete || return
+# force movement to default to line mode
+zle -U V
+# Use the standard vi-change to accept a vi motion.
+zle .vi-change || return
 read-from-minibuffer "!"
+zle .vi-cmd-mode
 local _save_cur=$CURSOR
 
 # cut buffer contains the deleted text and can be modified
-CUTBUFFER="$(eval $REPLY <<<$CUTBUFFER)"
+CUTBUFFER=$(eval "$REPLY" <<<"$CUTBUFFER")
 
 # put the modified text back in position.
 if [[ CURSOR -eq 0 || $BUFFER[CURSOR] = $'\n' ]]; then