From: Pierre-Elliott Bécue Date: Mon, 5 Sep 2016 16:23:30 +0000 (+0200) Subject: Reset menu->current when one re-sort the browser X-Git-Tag: neomutt-20160910~18^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e69af34e6bb396fd1c1999e203b5b326e8056c7f;p=neomutt Reset menu->current when one re-sort the browser --- diff --git a/browser.c b/browser.c index f6198b8fe..63c906168 100644 --- a/browser.c +++ b/browser.c @@ -1655,6 +1655,12 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num { BrowserSort |= reverse ? SORT_REVERSE : 0; browser_sort (&state); + + /* Reset menu position to 1. + * We do not risk overflow as the init_menu function changes + * current if it is bigger than state->entrylen. + */ + menu->current = 1; menu->redraw = REDRAW_FULL; } break;