1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

33696: simple up/down line widgets that don't go through history lines

This commit is contained in:
Oliver Kiddle 2014-11-15 21:31:29 +01:00
parent f26abf3a17
commit 13f3eec61d
4 changed files with 23 additions and 10 deletions

View file

@ -1,5 +1,8 @@
2014-11-15 Oliver Kiddle <opk@zsh.org>
* 33696: Doc/Zsh/zle.yo, Src/Zle/iwidgets.list, Src/Zle/zle_hist.c:
simple up/down line widgets that don't go through history lines
* 33695: Src/Zle/zle_vi.c, Test/X02zlevi.ztst, Test/comptest:
fix various vi-indent problems and vi-swap-case on a blank line

View file

@ -1078,6 +1078,10 @@ tindex(vi-beginning-of-line)
item(tt(vi-beginning-of-line))(
Move to the beginning of the line, without changing lines.
)
tindex(down-line)
item(tt(down-line) (unbound) (unbound) (unbound))(
Move down a line in the buffer.
)
tindex(end-of-line)
item(tt(end-of-line) (^E) (unbound) (unbound))(
Move to the end of the line. If already at the end
@ -1170,6 +1174,10 @@ tindex(vi-rev-repeat-find)
item(tt(vi-rev-repeat-find) (unbound) (,) (unbound))(
Repeat the last tt(vi-find) command in the opposite direction.
)
tindex(up-line)
item(tt(up-line) (unbound) (unbound) (unbound))(
Move up a line in the buffer.
)
enditem()
texinode(History Control)(Modifying Text)(Movement)(Zle Widgets)
subsect(History Control)

View file

@ -41,6 +41,7 @@
"digit-argument", digitargument, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_NOTCOMMAND
"down-case-word", downcaseword, 0
"down-history", downhistory, 0
"down-line", downline, ZLE_LINEMOVE | ZLE_LASTCOL
"down-line-or-history", downlineorhistory, ZLE_LINEMOVE | ZLE_LASTCOL
"down-line-or-search", downlineorsearch, ZLE_LINEMOVE | ZLE_LASTCOL
"emacs-backward-word", emacsbackwardword, 0
@ -112,6 +113,7 @@
"universal-argument", universalargument, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_NOTCOMMAND
"up-case-word", upcaseword, 0
"up-history", uphistory, 0
"up-line", upline, ZLE_LINEMOVE | ZLE_LASTCOL
"up-line-or-history", uplineorhistory, ZLE_LINEMOVE | ZLE_LASTCOL
"up-line-or-search", uplineorsearch, ZLE_LINEMOVE | ZLE_LASTCOL
"vi-add-eol", viaddeol, 0

View file

@ -227,14 +227,14 @@ uphistory(UNUSED(char **args))
}
/**/
static int
upline(void)
int
upline(char **args)
{
int n = zmult;
if (n < 0) {
zmult = -zmult;
n = -downline();
n = -downline(args);
zmult = -zmult;
return n;
}
@ -270,7 +270,7 @@ int
uplineorhistory(char **args)
{
int ocs = zlecs;
int n = upline();
int n = upline(args);
if (n) {
int m = zmult, ret;
@ -300,7 +300,7 @@ int
uplineorsearch(char **args)
{
int ocs = zlecs;
int n = upline();
int n = upline(args);
if (n) {
int m = zmult, ret;
@ -316,14 +316,14 @@ uplineorsearch(char **args)
}
/**/
static int
downline(void)
int
downline(char **args)
{
int n = zmult;
if (n < 0) {
zmult = -zmult;
n = -upline();
n = -upline(args);
zmult = -zmult;
return n;
}
@ -358,7 +358,7 @@ int
downlineorhistory(char **args)
{
int ocs = zlecs;
int n = downline();
int n = downline(args);
if (n) {
int m = zmult, ret;
@ -388,7 +388,7 @@ int
downlineorsearch(char **args)
{
int ocs = zlecs;
int n = downline();
int n = downline(args);
if (n) {
int m = zmult, ret;