diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-30 08:27:23 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-02 08:09:42 +1000 |
commit | 7b4a0f20b26d884cb756f09bc7514e57941709d4 (patch) | |
tree | 89fe1962fd3bc4b2b8a58b41eef15191839df909 /pkg/gui/gui.go | |
parent | 3b93b5dde410fbed657f04c16d6b89c80c5be861 (diff) |
add submodules context
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 57d450f8a..06d79e12d 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -209,6 +209,10 @@ type commitFilesPanelState struct { canRebase bool } +type submodulePanelState struct { + listPanelState +} + type panelStates struct { Files *filePanelState Branches *branchPanelState @@ -223,6 +227,7 @@ type panelStates struct { LineByLine *lineByLinePanelState Merging *mergingPanelState CommitFiles *commitFilesPanelState + Submodules *submodulePanelState } type searchingState struct { @@ -273,12 +278,12 @@ type Modes struct { } type guiState struct { - Files []*models.File - SubmoduleConfigs []*models.SubmoduleConfig - Branches []*models.Branch - Commits []*models.Commit - StashEntries []*models.StashEntry - CommitFiles []*models.CommitFile + Files []*models.File + Submodules []*models.SubmoduleConfig + Branches []*models.Branch + Commits []*models.Commit + StashEntries []*models.StashEntry + CommitFiles []*models.CommitFile // FilteredReflogCommits are the ones that appear in the reflog panel. // when in filtering mode we only include the ones that match the given path FilteredReflogCommits []*models.Commit @@ -358,6 +363,7 @@ func (gui *Gui) resetState() { Panels: &panelStates{ // TODO: work out why some of these are -1 and some are 0. Last time I checked there was a good reason but I'm less certain now Files: &filePanelState{listPanelState{SelectedLineIdx: -1}}, + Submodules: &submodulePanelState{listPanelState{SelectedLineIdx: -1}}, Branches: &branchPanelState{listPanelState{SelectedLineIdx: 0}}, Remotes: &remotePanelState{listPanelState{SelectedLineIdx: 0}}, RemoteBranches: &remoteBranchesState{listPanelState{SelectedLineIdx: -1}}, @@ -456,7 +462,7 @@ func (gui *Gui) Run() error { go gui.startBackgroundFetch() } - gui.goEvery(time.Second*10, gui.stopChan, gui.refreshFiles) + gui.goEvery(time.Second*10, gui.stopChan, gui.refreshFilesAndSubmodules) g.SetManager(gocui.ManagerFunc(gui.layout), gocui.ManagerFunc(gui.getFocusLayout())) |