diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | Src/Zle/zle_hist.c | 12 |
2 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog index ec6d865ce..d2f5a9814 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-05-29 Clint Adams <clint@zsh.org> + + * 145??: Src/Zle/zle_hist.c: repeat last vi history search + if search string is empty. + 2001-05-29 Oliver Kiddle <opk@zsh.org> * unposted: Completion/compdump, Completion/BSD/Command/_cvsup, @@ -21,7 +26,7 @@ 2001-05-29 Bart Schaefer <schaefer@zsh.org> - * 1454?: INSTALL: Mention "make check" and its usage. + * 14545: INSTALL: Mention "make check" and its usage. 2001-05-29 Chmouel Boudjnah <chmouel@mandrakesoft.com> diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c index a83ce7334..53481bd80 100644 --- a/Src/Zle/zle_hist.c +++ b/Src/Zle/zle_hist.c @@ -950,7 +950,7 @@ vifetchhistory(char **args) /* the last vi search */ -static char *visrchstr; +static char *visrchstr, *vipenultsrchstr; static int visrchsense; /**/ @@ -962,8 +962,12 @@ getvisrchstr(void) Thingy cmd; char *okeymap = curkeymapname; + if (vipenultsrchstr) { + zsfree(vipenultsrchstr); + } + if (visrchstr) { - zsfree(visrchstr); + vipenultsrchstr = visrchstr; visrchstr = NULL; } clearlist = 1; @@ -990,6 +994,10 @@ getvisrchstr(void) cmd == Th(z_vicmdmode)) { sbuf[sptr] = 0; visrchstr = metafy(sbuf + 1, sptr - 1, META_DUP); + if (!strlen(visrchstr)) { + zsfree(visrchstr); + visrchstr = vipenultsrchstr; + } ret = 1; sptr = 0; } else if(cmd == Th(z_backwarddeletechar) || |