mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
Merge pull request #540 from peauc/feature/issue-522-add-number-like-lazygit
Add navigation with numbers
This commit is contained in:
commit
c45bdea3a0
12 changed files with 84 additions and 0 deletions
|
|
@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
||||||
<kbd>_</kbd>: prev screen mode
|
<kbd>_</kbd>: prev screen mode
|
||||||
|
<kbd>1</kbd>: focus projects panel
|
||||||
|
<kbd>2</kbd>: focus services panel
|
||||||
|
<kbd>3</kbd>: focus containers panel
|
||||||
|
<kbd>4</kbd>: focus images panel
|
||||||
|
<kbd>5</kbd>: focus volumes panel
|
||||||
|
<kbd>6</kbd>: focus networks panel
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
||||||
|
|
@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
||||||
<kbd>_</kbd>: prev screen mode
|
<kbd>_</kbd>: prev screen mode
|
||||||
|
<kbd>1</kbd>: focus projects panel
|
||||||
|
<kbd>2</kbd>: focus services panel
|
||||||
|
<kbd>3</kbd>: focus containers panel
|
||||||
|
<kbd>4</kbd>: focus images panel
|
||||||
|
<kbd>5</kbd>: focus volumes panel
|
||||||
|
<kbd>6</kbd>: focus networks panel
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
||||||
|
|
@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
||||||
<kbd>_</kbd>: prev screen mode
|
<kbd>_</kbd>: prev screen mode
|
||||||
|
<kbd>1</kbd>: focus projects panel
|
||||||
|
<kbd>2</kbd>: focus services panel
|
||||||
|
<kbd>3</kbd>: focus containers panel
|
||||||
|
<kbd>4</kbd>: focus images panel
|
||||||
|
<kbd>5</kbd>: focus volumes panel
|
||||||
|
<kbd>6</kbd>: focus networks panel
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
||||||
|
|
@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
||||||
<kbd>_</kbd>: prev screen mode
|
<kbd>_</kbd>: prev screen mode
|
||||||
|
<kbd>1</kbd>: focus projects panel
|
||||||
|
<kbd>2</kbd>: focus services panel
|
||||||
|
<kbd>3</kbd>: focus containers panel
|
||||||
|
<kbd>4</kbd>: focus images panel
|
||||||
|
<kbd>5</kbd>: focus volumes panel
|
||||||
|
<kbd>6</kbd>: focus networks panel
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
||||||
|
|
@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
||||||
<kbd>_</kbd>: prev screen mode
|
<kbd>_</kbd>: prev screen mode
|
||||||
|
<kbd>1</kbd>: focus projects panel
|
||||||
|
<kbd>2</kbd>: focus services panel
|
||||||
|
<kbd>3</kbd>: focus containers panel
|
||||||
|
<kbd>4</kbd>: focus images panel
|
||||||
|
<kbd>5</kbd>: focus volumes panel
|
||||||
|
<kbd>6</kbd>: focus networks panel
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
||||||
|
|
@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
||||||
<kbd>_</kbd>: prev screen mode
|
<kbd>_</kbd>: prev screen mode
|
||||||
|
<kbd>1</kbd>: focus projects panel
|
||||||
|
<kbd>2</kbd>: focus services panel
|
||||||
|
<kbd>3</kbd>: focus containers panel
|
||||||
|
<kbd>4</kbd>: focus images panel
|
||||||
|
<kbd>5</kbd>: focus volumes panel
|
||||||
|
<kbd>6</kbd>: focus networks panel
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
||||||
|
|
@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>+</kbd>: modo de tela seguinte (normal/meia/tela cheia)
|
<kbd>+</kbd>: modo de tela seguinte (normal/meia/tela cheia)
|
||||||
<kbd>_</kbd>: modo de tela anterior
|
<kbd>_</kbd>: modo de tela anterior
|
||||||
|
<kbd>1</kbd>: focus projects panel
|
||||||
|
<kbd>2</kbd>: focus services panel
|
||||||
|
<kbd>3</kbd>: focus containers panel
|
||||||
|
<kbd>4</kbd>: focus images panel
|
||||||
|
<kbd>5</kbd>: focus volumes panel
|
||||||
|
<kbd>6</kbd>: focus networks panel
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
||||||
|
|
@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
||||||
<kbd>_</kbd>: prev screen mode
|
<kbd>_</kbd>: prev screen mode
|
||||||
|
<kbd>1</kbd>: focus projects panel
|
||||||
|
<kbd>2</kbd>: focus services panel
|
||||||
|
<kbd>3</kbd>: focus containers panel
|
||||||
|
<kbd>4</kbd>: focus images panel
|
||||||
|
<kbd>5</kbd>: focus volumes panel
|
||||||
|
<kbd>6</kbd>: focus networks panel
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
||||||
|
|
@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>+</kbd>: 下一个屏幕模式(正常/半屏/全屏)
|
<kbd>+</kbd>: 下一个屏幕模式(正常/半屏/全屏)
|
||||||
<kbd>_</kbd>: 上一个屏幕模式
|
<kbd>_</kbd>: 上一个屏幕模式
|
||||||
|
<kbd>1</kbd>: focus projects panel
|
||||||
|
<kbd>2</kbd>: focus services panel
|
||||||
|
<kbd>3</kbd>: focus containers panel
|
||||||
|
<kbd>4</kbd>: focus images panel
|
||||||
|
<kbd>5</kbd>: focus volumes panel
|
||||||
|
<kbd>6</kbd>: focus networks panel
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
||||||
|
|
@ -534,6 +534,15 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||||
}...)
|
}...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bindings = append(bindings, []*Binding{
|
||||||
|
{Handler: gui.handleGoTo(gui.Panels.Projects.View), Key: '1', Description: gui.Tr.FocusProjects},
|
||||||
|
{Handler: gui.handleGoTo(gui.Panels.Services.View), Key: '2', Description: gui.Tr.FocusServices},
|
||||||
|
{Handler: gui.handleGoTo(gui.Panels.Containers.View), Key: '3', Description: gui.Tr.FocusContainers},
|
||||||
|
{Handler: gui.handleGoTo(gui.Panels.Images.View), Key: '4', Description: gui.Tr.FocusImages},
|
||||||
|
{Handler: gui.handleGoTo(gui.Panels.Volumes.View), Key: '5', Description: gui.Tr.FocusVolumes},
|
||||||
|
{Handler: gui.handleGoTo(gui.Panels.Networks.View), Key: '6', Description: gui.Tr.FocusNetworks},
|
||||||
|
}...)
|
||||||
|
|
||||||
for _, panel := range gui.allListPanels() {
|
for _, panel := range gui.allListPanels() {
|
||||||
setUpDownClickBindings(panel.GetView().Name(), panel.HandlePrevLine, panel.HandleNextLine, panel.HandleClick)
|
setUpDownClickBindings(panel.GetView().Name(), panel.HandlePrevLine, panel.HandleNextLine, panel.HandleClick)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,13 @@ import (
|
||||||
"github.com/spkg/bom"
|
"github.com/spkg/bom"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (gui *Gui) handleGoTo(view *gocui.View) func(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
return func(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
gui.resetMainView()
|
||||||
|
return gui.switchFocus(view)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (gui *Gui) nextView(g *gocui.Gui, v *gocui.View) error {
|
func (gui *Gui) nextView(g *gocui.Gui, v *gocui.View) error {
|
||||||
sideViewNames := gui.sideViewNames()
|
sideViewNames := gui.sideViewNames()
|
||||||
var focusedViewName string
|
var focusedViewName string
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,13 @@ type TranslationSet struct {
|
||||||
LcNextScreenMode string
|
LcNextScreenMode string
|
||||||
LcPrevScreenMode string
|
LcPrevScreenMode string
|
||||||
FilterPrompt string
|
FilterPrompt string
|
||||||
|
|
||||||
|
FocusProjects string
|
||||||
|
FocusServices string
|
||||||
|
FocusContainers string
|
||||||
|
FocusImages string
|
||||||
|
FocusVolumes string
|
||||||
|
FocusNetworks string
|
||||||
}
|
}
|
||||||
|
|
||||||
func englishSet() TranslationSet {
|
func englishSet() TranslationSet {
|
||||||
|
|
@ -263,5 +270,12 @@ func englishSet() TranslationSet {
|
||||||
LcNextScreenMode: "next screen mode (normal/half/fullscreen)",
|
LcNextScreenMode: "next screen mode (normal/half/fullscreen)",
|
||||||
LcPrevScreenMode: "prev screen mode",
|
LcPrevScreenMode: "prev screen mode",
|
||||||
FilterPrompt: "filter",
|
FilterPrompt: "filter",
|
||||||
|
|
||||||
|
FocusProjects: "focus projects panel",
|
||||||
|
FocusServices: "focus services panel",
|
||||||
|
FocusContainers: "focus containers panel",
|
||||||
|
FocusImages: "focus images panel",
|
||||||
|
FocusVolumes: "focus volumes panel",
|
||||||
|
FocusNetworks: "focus networks panel",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue