Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: muddled completion search status



If a completion match search is active, then cursors/tab etc are used to
select a different match and then searching is restarted, the old status
(wrapped/failed etc) is included in the status line despite the search
string being empty.

There's a further feature where if you press Ctrl-S (or whatever) again,
it will restore the last search string used. This feature is also
triggered if your next key is that for a reverse search. I found this to
be confusing. The following will only restore that last search if you do
the search twice in the same direction.

Oliver

diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 2c7ec58..9c5b4ec 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -3271,13 +3271,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;
                     }
                 } else {
 		    if (cmd == Th(z_selfinsertunmeta)) {



Messages sorted by: Reverse Date, Date, Thread, Author