mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-22 15:11:02 +00:00
feat: add keybinding 'l' to main logs view for launching external pager directly
This commit is contained in:
parent
c5ceddd15e
commit
3396d26d8b
2 changed files with 17 additions and 0 deletions
|
|
@ -221,6 +221,16 @@ func (gui *Gui) handleContainerViewLogsExternal(g *gocui.Gui, v *gocui.View) err
|
|||
return gui.handleViewLogsExternal(ctr)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleMainViewLogsExternal(g *gocui.Gui, v *gocui.View) error {
|
||||
currentSideViewName := gui.currentSideViewName()
|
||||
if currentSideViewName == "containers" {
|
||||
return gui.handleContainerViewLogsExternal(g, v)
|
||||
} else if currentSideViewName == "services" {
|
||||
return gui.handleServiceViewLogsExternal(g, v)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (gui *Gui) handleViewLogsExternal(container *commands.Container) error {
|
||||
pager := gui.Config.UserConfig.Logs.Pager
|
||||
if pager == "" {
|
||||
|
|
|
|||
|
|
@ -452,6 +452,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||
Handler: gui.handleExitMain,
|
||||
Description: gui.Tr.Return,
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Key: 'l',
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMainViewLogsExternal,
|
||||
Description: "View logs with external pager",
|
||||
},
|
||||
{
|
||||
ViewName: "main",
|
||||
Key: gocui.KeyArrowLeft,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue