mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +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)
|
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 {
|
func (gui *Gui) handleViewLogsExternal(container *commands.Container) error {
|
||||||
pager := gui.Config.UserConfig.Logs.Pager
|
pager := gui.Config.UserConfig.Logs.Pager
|
||||||
if pager == "" {
|
if pager == "" {
|
||||||
|
|
|
||||||
|
|
@ -452,6 +452,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||||
Handler: gui.handleExitMain,
|
Handler: gui.handleExitMain,
|
||||||
Description: gui.Tr.Return,
|
Description: gui.Tr.Return,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ViewName: "main",
|
||||||
|
Key: 'l',
|
||||||
|
Modifier: gocui.ModNone,
|
||||||
|
Handler: gui.handleMainViewLogsExternal,
|
||||||
|
Description: "View logs with external pager",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Key: gocui.KeyArrowLeft,
|
Key: gocui.KeyArrowLeft,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue