Skip to content

Commit f827c82

Browse files
committed
Added SoftSwitchContext possibility
1 parent 6b0c7fb commit f827c82

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

bubblehelp.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ func GetCurrentContextKeymap() *Keymap {
7272

7373
// SwitchContext take care of properly changing context. Resets the current context before switching.
7474
func SwitchContext(context KeymapContext) {
75+
switchContext(context)
76+
ShowAll = false
77+
}
78+
79+
func SoftSwitchContext(context KeymapContext) {
80+
switchContext(context)
81+
}
82+
83+
func SwitchToPreviousContext() {
84+
SwitchContext(previousContext)
85+
}
86+
87+
func switchContext(context KeymapContext) {
7588
_, ok := Contexts[context]
7689

7790
if !ok {
@@ -86,11 +99,6 @@ func SwitchContext(context KeymapContext) {
8699

87100
previousContext = CurrentContext
88101
CurrentContext = context
89-
ShowAll = false
90-
}
91-
92-
func SwitchToPreviousContext() {
93-
SwitchContext(previousContext)
94102
}
95103

96104
// UpdateKeybindHelpDesc allows to temporary change the help description for a keybind in the current Keymap context.

0 commit comments

Comments
 (0)