File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1818
1919 // ShowAll is the flag to define whether it's the full or short help that will be rendered.
2020 ShowAll bool
21+
22+ // previousContext allows to reset the previous context.
23+ previousContext KeymapContext
2124)
2225
2326// Init is the first function that needs to be called in the start of the app.
@@ -55,10 +58,15 @@ func SwitchContext(context KeymapContext) {
5558 keymap .Reset ()
5659 }
5760
61+ previousContext = CurrentContext
5862 CurrentContext = context
5963 ShowAll = false
6064}
6165
66+ func SwitchToPreviousContext () {
67+ SwitchContext (previousContext )
68+ }
69+
6270// UpdateKeybindHelpDesc allows to temporary change the help description for a keybind in the current Keymap context.
6371func UpdateKeybindHelpDesc (keybind key.Binding , desc string ) {
6472 keymap := GetCurrentContextKeymap ()
You can’t perform that action at this time.
0 commit comments