From: Thomas Roessler Date: Wed, 11 Dec 2002 09:16:25 +0000 (+0000) Subject: Try to make search-next behave more closely to what people are used X-Git-Tag: mutt-1-5-3-rel~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12b95fd4910c94be23c301442b469f46550795cd;p=mutt Try to make search-next behave more closely to what people are used to, again. The behaviour introduced by this patch will give you the previous search string as the default, but will search-next when you just press enter without changing the search string. --- diff --git a/pager.c b/pager.c index 7f6c735c..54c91833 100644 --- a/pager.c +++ b/pager.c @@ -1954,13 +1954,13 @@ search_next: case OP_SEARCH: case OP_SEARCH_REVERSE: - buffer[0] = 0; + strfcpy (buffer, searchbuf, sizeof (buffer)); if (mutt_get_field ((SearchBack ? _("Reverse search: ") : _("Search: ")), buffer, sizeof (buffer), M_CLEAR) != 0) break; - if (!buffer[0]) + if (!strcmp (buffer, searchbuf)) { if (SearchCompiled) { @@ -1972,13 +1972,11 @@ search_next: goto search_next; } - /* - * preserve old behavior of doing nothing if there is no last - * used pattern. - */ - break; } - + + if (!buffer[0]) + break; + strfcpy (searchbuf, buffer, sizeof (searchbuf)); /* leave SearchBack alone if ch == OP_SEARCH_NEXT */