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
|
// Mapping number keys to jump between side panels
|
||||||
for _, panel := range gui.allSidePanels() {
|
for _, panel := range gui.allSidePanels() {
|
||||||
for idx := 1; idx <= len(gui.allSidePanels()); idx++ {
|
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() {
|
func (gui *Gui) configureViewProperties() {
|
||||||
gui.Config.UserConfig.Gui.ShowPanelJumps = true
|
|
||||||
if gui.Config.UserConfig.Gui.ShowPanelJumps {
|
if gui.Config.UserConfig.Gui.ShowPanelJumps {
|
||||||
gui.Views.Project.TitlePrefix = "[1]"
|
// defualt use number key mapping
|
||||||
// TODO service panel appear condition?
|
jumpLabels := []string{"[1]", "[2]", "[3]", "[4]", "[5]", "[6]"}
|
||||||
gui.Views.Services.TitlePrefix = "[2]"
|
idx := 0
|
||||||
gui.Views.Containers.TitlePrefix = "[3]"
|
gui.Views.Project.TitlePrefix = jumpLabels[idx]
|
||||||
gui.Views.Images.TitlePrefix = "[4]"
|
idx++
|
||||||
gui.Views.Volumes.TitlePrefix = "[5]"
|
if gui.DockerCommand.InDockerComposeProject {
|
||||||
gui.Views.Networks.TitlePrefix = "[6]"
|
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 {
|
} else {
|
||||||
gui.Views.Project.TitlePrefix = ""
|
gui.Views.Project.TitlePrefix = ""
|
||||||
gui.Views.Services.TitlePrefix = ""
|
gui.Views.Services.TitlePrefix = ""
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue