mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
When using the panel jump keys and the target panel is already active, switch tabs
This commit is contained in:
@ -10,15 +10,18 @@ import (
|
||||
|
||||
type JumpToSideWindowController struct {
|
||||
baseController
|
||||
c *ControllerCommon
|
||||
c *ControllerCommon
|
||||
nextTabFunc func() error
|
||||
}
|
||||
|
||||
func NewJumpToSideWindowController(
|
||||
c *ControllerCommon,
|
||||
nextTabFunc func() error,
|
||||
) *JumpToSideWindowController {
|
||||
return &JumpToSideWindowController{
|
||||
baseController: baseController{},
|
||||
c: c,
|
||||
nextTabFunc: nextTabFunc,
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,6 +49,10 @@ func (self *JumpToSideWindowController) GetKeybindings(opts types.KeybindingsOpt
|
||||
|
||||
func (self *JumpToSideWindowController) goToSideWindow(window string) func() error {
|
||||
return func() error {
|
||||
if self.c.Helpers().Window.CurrentWindow() == window {
|
||||
return self.nextTabFunc()
|
||||
}
|
||||
|
||||
context := self.c.Helpers().Window.GetContextForWindow(window)
|
||||
|
||||
return self.c.PushContext(context)
|
||||
|
Reference in New Issue
Block a user