mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
fix jump panel keybindings display
This commit is contained in:
parent
b8bf22ead8
commit
4cf9544abf
2 changed files with 20 additions and 9 deletions
|
|
@ -525,7 +525,9 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||
// Mapping number keys to jump between side panels
|
||||
for _, panel := range gui.allSidePanels() {
|
||||
for idx := 1; idx <= len(gui.allSidePanels()); idx++ {
|
||||
bindings = append(bindings, &Binding{ViewName: panel.GetView().Name(), Key: rune('0' + idx), Modifier: gocui.ModNone, Handler: wrappedHandlerWithKey(gui.jumpToSideView, idx)})
|
||||
bindings = append(bindings,
|
||||
&Binding{ViewName: panel.GetView().Name(), Key: rune('0' + idx), Modifier: gocui.ModNone, Handler: wrappedHandlerWithKey(gui.jumpToSideView, idx)},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -178,15 +178,24 @@ func (gui *Gui) createAllViews() error {
|
|||
}
|
||||
|
||||
func (gui *Gui) configureViewProperties() {
|
||||
gui.Config.UserConfig.Gui.ShowPanelJumps = true
|
||||
if gui.Config.UserConfig.Gui.ShowPanelJumps {
|
||||
gui.Views.Project.TitlePrefix = "[1]"
|
||||
// TODO service panel appear condition?
|
||||
gui.Views.Services.TitlePrefix = "[2]"
|
||||
gui.Views.Containers.TitlePrefix = "[3]"
|
||||
gui.Views.Images.TitlePrefix = "[4]"
|
||||
gui.Views.Volumes.TitlePrefix = "[5]"
|
||||
gui.Views.Networks.TitlePrefix = "[6]"
|
||||
// defualt use number key mapping
|
||||
jumpLabels := []string{"[1]", "[2]", "[3]", "[4]", "[5]", "[6]"}
|
||||
idx := 0
|
||||
gui.Views.Project.TitlePrefix = jumpLabels[idx]
|
||||
idx++
|
||||
if gui.DockerCommand.InDockerComposeProject {
|
||||
gui.Views.Services.TitlePrefix = jumpLabels[idx]
|
||||
idx++
|
||||
}
|
||||
gui.Views.Containers.TitlePrefix = jumpLabels[idx]
|
||||
idx++
|
||||
gui.Views.Images.TitlePrefix = jumpLabels[idx]
|
||||
idx++
|
||||
gui.Views.Volumes.TitlePrefix = jumpLabels[idx]
|
||||
idx++
|
||||
gui.Views.Networks.TitlePrefix = jumpLabels[idx]
|
||||
idx++
|
||||
} else {
|
||||
gui.Views.Project.TitlePrefix = ""
|
||||
gui.Views.Services.TitlePrefix = ""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue