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/commits_panel.go | |
parent | 48f1adad49c01cf7f093e8f9921582690bef55a7 (diff) |
allowing commit files to be viewed in reflog as well
Diffstat (limited to 'pkg/gui/commits_panel.go')
-rw-r--r-- | pkg/gui/commits_panel.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index 66600f3ec..148a0e460 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -499,12 +499,20 @@ func (gui *Gui) HandlePasteCommits(g *gocui.Gui, v *gocui.View) error { }) } -func (gui *Gui) handleSwitchToCommitFilesPanel() error { +func (gui *Gui) handleViewCommitFiles() error { + commit := gui.getSelectedCommit() + if commit == nil { + return nil + } + + gui.State.Panels.CommitFiles.refName = commit.Sha + gui.Contexts.CommitFiles.Context.SetParentContext(gui.Contexts.BranchCommits.Context) + if err := gui.refreshCommitFilesView(); err != nil { return err } - return gui.switchContext(gui.Contexts.BranchCommits.Files.Context) + return gui.switchContext(gui.Contexts.CommitFiles.Context) } func (gui *Gui) hasCommit(commits []*commands.Commit, target string) (int, bool) { |