]> granicus.if.org Git - neomutt/commitdiff
Reset menu->current when one re-sort the browser
authorPierre-Elliott Bécue <becue@crans.org>
Mon, 5 Sep 2016 16:23:30 +0000 (18:23 +0200)
committerPierre-Elliott Bécue <becue@crans.org>
Tue, 6 Sep 2016 12:34:16 +0000 (14:34 +0200)
browser.c

index f6198b8fe113b54deb35831d9f31cf0f68750312..63c90616851de0ac373f3a7b54d6bd5399b71601 100644 (file)
--- 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;