diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-22 08:49:02 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | 974c6510b8fbda23b79f365efb18f2091cd757a6 (patch) | |
tree | 3b0e87827f2785cf37b7c8e09a64c7bac69fec33 /pkg/gui/gui.go | |
parent | 41df63cdc4d799ce7d78ecb0b1ed96dea65f1739 (diff) |
add sub commit context
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 1b6446909..b0249b37a 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -173,6 +173,13 @@ type reflogCommitPanelState struct { listPanelState } +type subCommitPanelState struct { + listPanelState + + // e.g. name of branch whose commits we're looking at + refName string +} + type stashPanelState struct { listPanelState } @@ -199,6 +206,7 @@ type panelStates struct { Tags *tagsPanelState Commits *commitPanelState ReflogCommits *reflogCommitPanelState + SubCommits *subCommitPanelState Stash *stashPanelState Menu *menuPanelState LineByLine *lineByLinePanelState @@ -237,6 +245,7 @@ type guiState struct { // if we're not in filtering mode, CommitFiles and FilteredReflogCommits will be // one and the same ReflogCommits []*commands.Commit + SubCommits []*commands.Commit Remotes []*commands.Remote RemoteBranches []*commands.RemoteBranch Tags []*commands.Tag @@ -289,13 +298,15 @@ func (gui *Gui) resetState() { CherryPickedCommits: make([]*commands.Commit, 0), StashEntries: make([]*commands.StashEntry, 0), 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}}, Branches: &branchPanelState{listPanelState{SelectedLineIdx: 0}}, Remotes: &remotePanelState{listPanelState{SelectedLineIdx: 0}}, RemoteBranches: &remoteBranchesState{listPanelState{SelectedLineIdx: -1}}, Tags: &tagsPanelState{listPanelState{SelectedLineIdx: -1}}, Commits: &commitPanelState{listPanelState: listPanelState{SelectedLineIdx: -1}, LimitCommits: true}, - ReflogCommits: &reflogCommitPanelState{listPanelState{SelectedLineIdx: 0}}, // TODO: might need to make -1 + ReflogCommits: &reflogCommitPanelState{listPanelState{SelectedLineIdx: 0}}, + SubCommits: &subCommitPanelState{listPanelState: listPanelState{SelectedLineIdx: 0}, refName: ""}, CommitFiles: &commitFilesPanelState{listPanelState: listPanelState{SelectedLineIdx: -1}, refName: ""}, Stash: &stashPanelState{listPanelState{SelectedLineIdx: -1}}, Menu: &menuPanelState{listPanelState: listPanelState{SelectedLineIdx: 0}, OnPress: nil}, |