@@ -41,15 +41,7 @@ func (self *ConfirmationController) GetKeybindings(opts types.KeybindingsOpts) [
41
41
Key : opts .GetKey (opts .Config .Universal .TogglePanel ),
42
42
Handler : func () error {
43
43
if len (self .c .Contexts ().Suggestions .State .Suggestions ) > 0 {
44
- subtitle := ""
45
- if self .c .State ().GetRepoState ().GetCurrentPopupOpts ().HandleDeleteSuggestion != nil {
46
- // We assume that whenever things are deletable, they
47
- // are also editable, so we show both keybindings
48
- subtitle = fmt .Sprintf (self .c .Tr .SuggestionsSubtitle ,
49
- self .c .UserConfig ().Keybinding .Universal .Remove , self .c .UserConfig ().Keybinding .Universal .Edit )
50
- }
51
- self .c .Views ().Suggestions .Subtitle = subtitle
52
- self .c .Context ().Replace (self .c .Contexts ().Suggestions )
44
+ self .switchToSuggestions ()
53
45
}
54
46
return nil
55
47
},
@@ -72,3 +64,15 @@ func (self *ConfirmationController) Context() types.Context {
72
64
func (self * ConfirmationController ) context () * context.ConfirmationContext {
73
65
return self .c .Contexts ().Confirmation
74
66
}
67
+
68
+ func (self * ConfirmationController ) switchToSuggestions () {
69
+ subtitle := ""
70
+ if self .c .State ().GetRepoState ().GetCurrentPopupOpts ().HandleDeleteSuggestion != nil {
71
+ // We assume that whenever things are deletable, they
72
+ // are also editable, so we show both keybindings
73
+ subtitle = fmt .Sprintf (self .c .Tr .SuggestionsSubtitle ,
74
+ self .c .UserConfig ().Keybinding .Universal .Remove , self .c .UserConfig ().Keybinding .Universal .Edit )
75
+ }
76
+ self .c .Views ().Suggestions .Subtitle = subtitle
77
+ self .c .Context ().Replace (self .c .Contexts ().Suggestions )
78
+ }
0 commit comments