Fix #403: Clear logs

This commit is contained in:
Sunny Tiwari 2023-07-19 16:37:50 +05:30
parent 15bc01b9af
commit f8bcff18d6
3 changed files with 18 additions and 0 deletions

View File

@ -449,6 +449,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Modifier: gocui.ModNone,
Handler: gui.scrollRightMain,
},
{
ViewName: "main",
Key: gocui.KeyCtrlL,
Modifier: gocui.ModNone,
Handler: wrappedHandler(gui.handleClearMain),
Description: gui.Tr.ClearMain,
},
{
ViewName: "main",
Key: 'h',

View File

@ -111,3 +111,12 @@ func (gui *Gui) handleMainClick() error {
return gui.switchFocus(gui.Views.Main)
}
func (gui *Gui) handleClearMain() error {
if gui.popupPanelFocused() {
return nil
}
gui.clearMainView()
return nil
}

View File

@ -126,6 +126,7 @@ type TranslationSet struct {
LcNextScreenMode string
LcPrevScreenMode string
ClearMain string
FilterPrompt string
}
@ -260,6 +261,7 @@ func englishSet() TranslationSet {
LcNextScreenMode: "next screen mode (normal/half/fullscreen)",
LcPrevScreenMode: "prev screen mode",
ClearMain: "clear main panel",
FilterPrompt: "filter",
}
}