mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-11 13:01:28 +02:00
38936: fix vi-pipe function for option compatibility
This commit is contained in:
parent
932ff2b6f8
commit
ac05343049
2 changed files with 10 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
||||||
2016-07-24 Oliver Kiddle <opk@zsh.org>
|
2016-07-24 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
|
* 38936: Functions/Zle/vi-pipe: fix for option compatibility
|
||||||
|
|
||||||
* 38929: Doc/Zsh/contrib.yo, Functions/Zle/select-word-match:
|
* 38929: Doc/Zsh/contrib.yo, Functions/Zle/select-word-match:
|
||||||
new vim style text object using match-words-by-style mechanism
|
new vim style text object using match-words-by-style mechanism
|
||||||
|
|
||||||
|
|
|
@ -7,16 +7,21 @@
|
||||||
# autoload -Uz vi-pipe
|
# autoload -Uz vi-pipe
|
||||||
# bindkey -a '!' vi-pipe
|
# bindkey -a '!' vi-pipe
|
||||||
|
|
||||||
|
setopt localoptions noksharrays
|
||||||
|
|
||||||
autoload -Uz read-from-minibuffer
|
autoload -Uz read-from-minibuffer
|
||||||
local _save_cut="$CUTBUFFER" REPLY
|
local _save_cut="$CUTBUFFER" REPLY
|
||||||
|
|
||||||
# Use the standard vi-delete to accept a vi motion.
|
# force movement to default to line mode
|
||||||
zle .vi-delete || return
|
zle -U V
|
||||||
|
# Use the standard vi-change to accept a vi motion.
|
||||||
|
zle .vi-change || return
|
||||||
read-from-minibuffer "!"
|
read-from-minibuffer "!"
|
||||||
|
zle .vi-cmd-mode
|
||||||
local _save_cur=$CURSOR
|
local _save_cur=$CURSOR
|
||||||
|
|
||||||
# cut buffer contains the deleted text and can be modified
|
# 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.
|
# put the modified text back in position.
|
||||||
if [[ CURSOR -eq 0 || $BUFFER[CURSOR] = $'\n' ]]; then
|
if [[ CURSOR -eq 0 || $BUFFER[CURSOR] = $'\n' ]]; then
|
||||||
|
|
Loading…
Reference in a new issue