From 0cc65dba531a792db26592a4e9c1efe5f9f667bd Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Wed, 1 Jun 2011 15:30:20 +0000 Subject: users/16064: example widget for line motion inside multiline buffers without navigating history --- Functions/Zle/move-line-in-buffer | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Functions/Zle/move-line-in-buffer (limited to 'Functions/Zle/move-line-in-buffer') diff --git a/Functions/Zle/move-line-in-buffer b/Functions/Zle/move-line-in-buffer new file mode 100644 index 000000000..1a0efd9ca --- /dev/null +++ b/Functions/Zle/move-line-in-buffer @@ -0,0 +1,16 @@ +#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 -- cgit v1.2.3 From c0d2cb5d025290efd0301bce4ddb7ad23c129eae Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sun, 5 Jun 2011 05:40:53 +0000 Subject: fix whitespace in Functions/Zle/move-line-in-buffer --- ChangeLog | 7 ++++++- Functions/Zle/move-line-in-buffer | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Functions/Zle/move-line-in-buffer') diff --git a/ChangeLog b/ChangeLog index d2dab008a..45faa0016 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-06-05 Clint Adams + + * unposted: Functions/Zle/move-line-in-buffer: clean + the funny characters out of move-line-in-buffer. + 2011-06-04 Peter Stephenson * Completion/Zsh/Context/_brace_parameter, Src/Zle/compcore.c @@ -14958,5 +14963,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5362 $ +* $Revision: 1.5363 $ ***************************************************** diff --git a/Functions/Zle/move-line-in-buffer b/Functions/Zle/move-line-in-buffer index 1a0efd9ca..5f37a9d71 100644 --- a/Functions/Zle/move-line-in-buffer +++ b/Functions/Zle/move-line-in-buffer @@ -12,5 +12,5 @@ local hno=$HISTNO curs=$CURSOR zle .${WIDGET:s/in-buffer/or-history} "$@" && -    (( HISTNO != hno && (HISTNO=hno, CURSOR=curs) )) + (( HISTNO != hno && (HISTNO=hno, CURSOR=curs) )) return 0 -- cgit v1.2.3