mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-23 12:18:51 +02:00
ensure we switch tabs when switching context
This commit is contained in:
parent
2afbd7ba7f
commit
f0cd730fbb
@ -367,11 +367,18 @@ func (gui *Gui) onBranchesTabClick(tabIndex int) error {
|
|||||||
return gui.switchBranchesPanelContext(contexts[tabIndex])
|
return gui.switchBranchesPanelContext(contexts[tabIndex])
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: make this switch tabs as well if necessary
|
|
||||||
func (gui *Gui) switchBranchesPanelContext(context string) error {
|
func (gui *Gui) switchBranchesPanelContext(context string) error {
|
||||||
branchesView := gui.getBranchesView()
|
branchesView := gui.getBranchesView()
|
||||||
branchesView.Context = context
|
branchesView.Context = context
|
||||||
|
|
||||||
|
contextTabIndexMap := map[string]int{
|
||||||
|
"local-branches": 0,
|
||||||
|
"remotes": 1,
|
||||||
|
"remote-branches": 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
branchesView.TabIndex = contextTabIndexMap[context]
|
||||||
|
|
||||||
switch context {
|
switch context {
|
||||||
case "local-branches":
|
case "local-branches":
|
||||||
return gui.renderLocalBranchesWithSelection()
|
return gui.renderLocalBranchesWithSelection()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user