1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-26 05:51:08 +02:00
zsh/Functions/Zle/move-line-in-buffer
2011-06-01 15:30:20 +00:00

16 lines
424 B
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#autoload
# Line motions that do not leave the current history entry,
# for editing in multi-line buffers.
# To use:
# autoload -Uz move-line-in-buffer
# zle -N up-line-in-buffer move-line-in-buffer
# zle -N down-line-in-buffer move-line-in-buffer
#
# then bindkey as you prefer
local hno=$HISTNO curs=$CURSOR
zle .${WIDGET:s/in-buffer/or-history} "$@" &&
    (( HISTNO != hno && (HISTNO=hno, CURSOR=curs) ))
return 0