1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

add remotes context to branches view

This commit is contained in:
Jesse Duffield
2019-11-13 23:18:31 +11:00
parent 092f27495a
commit e6be849eb2
3 changed files with 57 additions and 0 deletions

View File

@ -107,8 +107,14 @@ type filePanelState struct {
SelectedLine int
}
// TODO: consider splitting this out into the window and the branches view
type branchPanelState struct {
SelectedLine int
ContextIndex int
}
type remotePanelState struct {
SelectedLine int
}
type commitPanelState struct {
@ -137,6 +143,7 @@ type statusPanelState struct {
type panelStates struct {
Files *filePanelState
Branches *branchPanelState
Remotes *remotePanelState
Commits *commitPanelState
Stash *stashPanelState
Menu *menuPanelState
@ -153,6 +160,7 @@ type guiState struct {
StashEntries []*commands.StashEntry
CommitFiles []*commands.CommitFile
DiffEntries []*commands.Commit
Remotes []*commands.Remote
MenuItemCount int // can't store the actual list because it's of interface{} type
PreviousView string
Platform commands.Platform
@ -183,6 +191,7 @@ func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *comma
Panels: &panelStates{
Files: &filePanelState{SelectedLine: -1},
Branches: &branchPanelState{SelectedLine: 0},
Remotes: &remotePanelState{SelectedLine: -1},
Commits: &commitPanelState{SelectedLine: -1},
CommitFiles: &commitFilesPanelState{SelectedLine: -1},
Stash: &stashPanelState{SelectedLine: -1},
@ -480,6 +489,8 @@ func (gui *Gui) layout(g *gocui.Gui) error {
return err
}
branchesView.Title = gui.Tr.SLocalize("BranchesTitle")
branchesView.Tabs = []string{"Local Branches", "Remotes"}
branchesView.TabIndex = gui.State.Panels.Branches.ContextIndex
branchesView.FgColor = textColor
}