summaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2017-03-26 18:31:40 -0700
committerKevin McCarthy <kevin@8t8.us>2017-03-26 18:31:40 -0700
commit5af1b825aef689984504a847c8589b2593a08d17 (patch)
tree96cbf00f1d8485b8f3466c62663cd63289159732 /menu.c
parente0634939199b13b97d321697a8307df710c2fe4f (diff)
Change CurrentMenu to be controlled by the menu stack.
The pager menu is a bit tricky with respect to the menu->menu and CurrentMenu, so add a few comments.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/menu.c b/menu.c
index 46debdb8..891a580e 100644
--- a/menu.c
+++ b/menu.c
@@ -742,6 +742,7 @@ void mutt_push_current_menu (MUTTMENU *menu)
}
MenuStack[MenuStackCount++] = menu;
+ CurrentMenu = menu->menu;
}
void mutt_pop_current_menu (MUTTMENU *menu)
@@ -754,6 +755,14 @@ void mutt_pop_current_menu (MUTTMENU *menu)
}
MenuStackCount--;
+ if (MenuStackCount)
+ {
+ CurrentMenu = MenuStack[MenuStackCount - 1]->menu;
+ }
+ else
+ {
+ CurrentMenu = MENU_MAIN;
+ }
}
@@ -1060,7 +1069,6 @@ int mutt_menuLoop (MUTTMENU *menu)
break;
case OP_ENTER_COMMAND:
- CurrentMenu = menu->menu;
mutt_enter_command ();
if (option (OPTFORCEREDRAWINDEX))
{