Commit 8c6cecbc authored by Rocco Rutte's avatar Rocco Rutte

Respect $wrap_search in generic menu search (e.g. for browser)

parent 34f7a759
2008-05-29 11:20 +0200 Rocco Rutte <[email protected]> (18e7849e4c7c)
* doc/Makefile.am: Only install mutt_dotlock(1) if binary is
installed, too (closes #1601).
2008-05-28 22:22 -0700 Paul Walker <[email protected]> (f4259a92dab6)
* ChangeLog, doc/Muttrc.head: Make default muttrc header weeding
tidier. Closes #286.
2008-05-23 01:40 -0400 Todd Zullinger <[email protected]> (73a180edce53)
* pgp.c: Call mutt_need_hard_redraw() in pgp_decrypt_part().
......
......@@ -713,7 +713,7 @@ void mutt_menuDestroy (MUTTMENU **p)
static int menu_search (MUTTMENU *menu, int op)
{
int r;
int r, wrap = 0;
int searchDir;
regex_t re;
char buf[SHORT_STRING];
......@@ -750,6 +750,9 @@ static int menu_search (MUTTMENU *menu, int op)
}
r = menu->current + searchDir;
search_next:
if (wrap)
mutt_message (_("Search wrapped to top."));
while (r >= 0 && r < menu->max)
{
if (menu->search (menu, &re, r) == 0)
......@@ -761,6 +764,11 @@ static int menu_search (MUTTMENU *menu, int op)
r += searchDir;
}
if (option (OPTWRAPSEARCH) && wrap++ == 0)
{
r = searchDir == 1 ? 0 : menu->max - 1;
goto search_next;
}
regfree (&re);
mutt_error _("Not found.");
return (-1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment