diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-21 09:12:45 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | ddf25e14afe5ddfc2527149c54ea55ea2e83610a (patch) | |
tree | a75ce97a36ce9ec3e4215c20e2a26e82fea81304 /pkg/gui/list_context.go | |
parent | 48f1adad49c01cf7f093e8f9921582690bef55a7 (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.go | 11 |
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, |