Skip to content

Commit c150b1d

Browse files
sunny-Ne5jorgemxm
authored andcommitted
Fix jesseduffield#403: Clear logs
1 parent be05115 commit c150b1d

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

pkg/gui/keybindings.go

+7
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
449449
Modifier: gocui.ModNone,
450450
Handler: gui.scrollRightMain,
451451
},
452+
{
453+
ViewName: "main",
454+
Key: gocui.KeyCtrlL,
455+
Modifier: gocui.ModNone,
456+
Handler: wrappedHandler(gui.handleClearMain),
457+
Description: gui.Tr.ClearMain,
458+
},
452459
{
453460
ViewName: "main",
454461
Key: 'h',

pkg/gui/main_panel.go

+9
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,12 @@ func (gui *Gui) handleMainClick() error {
111111

112112
return gui.switchFocus(gui.Views.Main)
113113
}
114+
115+
func (gui *Gui) handleClearMain() error {
116+
if gui.popupPanelFocused() {
117+
return nil
118+
}
119+
120+
gui.clearMainView()
121+
return nil
122+
}

pkg/i18n/english.go

+2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ type TranslationSet struct {
127127

128128
LcNextScreenMode string
129129
LcPrevScreenMode string
130+
ClearMain string
130131
FilterPrompt string
131132
}
132133

@@ -262,6 +263,7 @@ func englishSet() TranslationSet {
262263

263264
LcNextScreenMode: "next screen mode (normal/half/fullscreen)",
264265
LcPrevScreenMode: "prev screen mode",
266+
ClearMain: "clear main panel",
265267
FilterPrompt: "filter",
266268
}
267269
}

0 commit comments

Comments
 (0)