browser: make M-W/M-Q functional right after startup, if there is history

Do the same what the normal "research" code does: if nothing was
searched for yet during this session, and there is a history of
search items, then search for the last item in that history.
master
Benno Schulenberg 2020-09-02 09:22:50 +02:00
parent e32ca98ccf
commit 1db7d57a24
1 changed files with 6 additions and 0 deletions

View File

@ -725,6 +725,12 @@ void do_filesearch(bool forwards)
* either forwards or backwards. */ * either forwards or backwards. */
void do_fileresearch(bool forwards) void do_fileresearch(bool forwards)
{ {
#ifdef ENABLE_HISTORIES
/* If nothing was searched for yet, take the last item from history. */
if (*last_search == '\0' && searchbot->prev != NULL)
last_search = mallocstrcpy(last_search, searchbot->prev->data);
#endif
if (*last_search == '\0') if (*last_search == '\0')
statusbar(_("No current search pattern")); statusbar(_("No current search pattern"));
else else