summaryrefslogtreecommitdiffstats
path: root/pkg/gui/commit_files_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-03-24 22:07:30 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-26 18:00:46 +1100
commit13b90ac37f40baa648c25fab6d299ae0fa59118b (patch)
tree61dd23273a4b32c3c8d191759cc0ce3ae9d7c08a /pkg/gui/commit_files_panel.go
parente039429885996f1335430a856b846d8dc6279325 (diff)
support viewing commits of reflog entry and show better view title
Diffstat (limited to 'pkg/gui/commit_files_panel.go')
-rw-r--r--pkg/gui/commit_files_panel.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/pkg/gui/commit_files_panel.go b/pkg/gui/commit_files_panel.go
index 21afc54f4..4f292d3eb 100644
--- a/pkg/gui/commit_files_panel.go
+++ b/pkg/gui/commit_files_panel.go
@@ -39,24 +39,20 @@ func (gui *Gui) commitFilesRenderToMain() error {
}
func (gui *Gui) SwitchToCommitFilesContext(opts controllers.SwitchToCommitFilesContextOpts) error {
- // sometimes the commitFiles view is already shown in another window, so we need to ensure that window
- // no longer considers the commitFiles view as its main view.
- gui.resetWindowContext(gui.State.Contexts.CommitFiles)
-
gui.State.Contexts.CommitFiles.SetSelectedLineIdx(0)
gui.State.Contexts.CommitFiles.SetRefName(opts.RefName)
gui.State.Contexts.CommitFiles.SetCanRebase(opts.CanRebase)
gui.State.Contexts.CommitFiles.SetParentContext(opts.Context)
gui.State.Contexts.CommitFiles.SetWindowName(opts.Context.GetWindowName())
- if err := gui.refreshCommitFilesView(); err != nil {
+ if err := gui.refreshCommitFilesContext(); err != nil {
return err
}
return gui.c.PushContext(gui.State.Contexts.CommitFiles)
}
-func (gui *Gui) refreshCommitFilesView() error {
+func (gui *Gui) refreshCommitFilesContext() error {
currentSideContext := gui.currentSideContext()
if currentSideContext.GetKey() == context.COMMIT_FILES_CONTEXT_KEY || currentSideContext.GetKey() == context.LOCAL_COMMITS_CONTEXT_KEY {
if err := gui.handleRefreshPatchBuildingPanel(-1); err != nil {