about summary refs log tree commit diff
path: root/Src/Zle/complist.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/complist.c')
-rw-r--r--Src/Zle/complist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index a02a5c37b..39c0c314d 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -3287,13 +3287,15 @@ domenuselect(Hookdef dummy, Chdata dat)
                 }
                 if (!ins) {
                     if (was) {
-                        if (!*msearchstr && lastsearch) {
+                        if (!*msearchstr && lastsearch &&
+			    back == (mode == MM_BSEARCH)) {
                             msearchstr = dupstring(lastsearch);
                             mode = 0;
                         }
                     } else {
                         msearchstr = "";
                         msearchstack = NULL;
+			msearchstate = MS_OK;
                     }
                 }
                 if (cmd == Th(z_selfinsertunmeta)) {