diff options
author | Kevin McCarthy <kevin@8t8.us> | 2017-03-26 18:31:39 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2017-03-26 18:31:39 -0700 |
commit | e0634939199b13b97d321697a8307df710c2fe4f (patch) | |
tree | bac86e7678474dcf57a61a17e4c88bdf97488f50 /browser.c | |
parent | 26331cb7d71444f2a870dfa0dc3a6f33f946b5e8 (diff) |
Add a menu stack to track current and past menus.
Change the pager to use a MENU, right now just to hold the refresh
state.
Diffstat (limited to 'browser.c')
-rw-r--r-- | browser.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -611,7 +611,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num char helpstr[LONG_STRING]; char title[STRING]; struct browser_state state; - MUTTMENU *menu; + MUTTMENU *menu = NULL; struct stat st; int i, killPrefix = 0; int multiple = (flags & MUTT_SEL_MULTI) ? 1 : 0; @@ -722,6 +722,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_FOLDER, FolderHelp); + mutt_push_current_menu (menu); init_menu (&state, menu, title, sizeof (title), buffy); @@ -908,7 +909,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num } destroy_state (&state); - mutt_menuDestroy (&menu); goto bail; case OP_BROWSER_TELL: @@ -1080,7 +1080,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num mutt_error _("Error scanning directory."); if (examine_directory (menu, &state, LastDir, prefix) == -1) { - mutt_menuDestroy (&menu); goto bail; } } @@ -1151,7 +1150,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num else { mutt_error _("Error scanning directory."); - mutt_menuDestroy (&menu); goto bail; } killPrefix = 0; @@ -1246,7 +1244,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num { strfcpy (f, buf, flen); destroy_state (&state); - mutt_menuDestroy (&menu); goto bail; } MAYBE_REDRAW (menu->redraw); @@ -1264,7 +1261,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num { strfcpy (f, state.entry[menu->current].name, flen); destroy_state (&state); - mutt_menuDestroy (&menu); goto bail; } else @@ -1296,7 +1292,13 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num } bail: - + + if (menu) + { + mutt_pop_current_menu (menu); + mutt_menuDestroy (&menu); + } + if (!folder) strfcpy (LastDir, LastDirBackup, sizeof (LastDir)); |