summaryrefslogtreecommitdiffstats
path: root/pkg/gui/list_context.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-21 09:12:45 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commitddf25e14afe5ddfc2527149c54ea55ea2e83610a (patch)
treea75ce97a36ce9ec3e4215c20e2a26e82fea81304 /pkg/gui/list_context.go
parent48f1adad49c01cf7f093e8f9921582690bef55a7 (diff)
allowing commit files to be viewed in reflog as well
Diffstat (limited to 'pkg/gui/list_context.go')
-rw-r--r--pkg/gui/list_context.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/gui/list_context.go b/pkg/gui/list_context.go
index 5e37e6c86..f70c202b7 100644
--- a/pkg/gui/list_context.go
+++ b/pkg/gui/list_context.go
@@ -19,12 +19,21 @@ type ListContext struct {
Gui *Gui
RendersToMainView bool
Kind int
+ ParentContext Context
}
type ListItem interface {
ID() string
}
+func (lc *ListContext) SetParentContext(c Context) {
+ lc.ParentContext = c
+}
+
+func (lc *ListContext) GetParentContext() Context {
+ return lc.ParentContext
+}
+
func (lc *ListContext) GetSelectedItem() ListItem {
items := lc.GetItems()
@@ -317,7 +326,7 @@ func (gui *Gui) branchCommitsListContext() *ListContext {
GetItemsLength: func() int { return len(gui.State.Commits) },
GetPanelState: func() IListPanelState { return gui.State.Panels.Commits },
OnFocus: gui.handleCommitSelect,
- OnClickSelectedItem: gui.handleSwitchToCommitFilesPanel,
+ OnClickSelectedItem: gui.handleViewCommitFiles,
Gui: gui,
RendersToMainView: true,
Kind: SIDE_CONTEXT,