about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-05-29 20:20:34 +0000
committerClint Adams <clint@users.sourceforge.net>2001-05-29 20:20:34 +0000
commite56c42c9fe218817b8bad84e0a279f0030bc7c7c (patch)
tree5673e66f7154709299ffe3d04b148fb6f8aec6d0
parent56528ccb661d4985776234c89355a14093063534 (diff)
downloadzsh-e56c42c9fe218817b8bad84e0a279f0030bc7c7c.tar.gz
zsh-e56c42c9fe218817b8bad84e0a279f0030bc7c7c.tar.xz
zsh-e56c42c9fe218817b8bad84e0a279f0030bc7c7c.zip
145??: repeat last vi history search if search string is blank
-rw-r--r--ChangeLog7
-rw-r--r--Src/Zle/zle_hist.c12
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) ||