summaryrefslogtreecommitdiffstats
path: root/pkg/gui/commit_files_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-18 22:02:35 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commitf5b22d94d939b0fc1aff433686e891e0a7507950 (patch)
tree9812c4c7f3855d7e3fe973dacf5533ef04463c3d /pkg/gui/commit_files_panel.go
parent3c87ff4eff46449d5e697e954b3bdf01d2c76f19 (diff)
WIP
Diffstat (limited to 'pkg/gui/commit_files_panel.go')
-rw-r--r--pkg/gui/commit_files_panel.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg/gui/commit_files_panel.go b/pkg/gui/commit_files_panel.go
index 57757445d..6d2981456 100644
--- a/pkg/gui/commit_files_panel.go
+++ b/pkg/gui/commit_files_panel.go
@@ -21,29 +21,29 @@ func (gui *Gui) handleCommitFileSelect() error {
return nil
}
- gui.getMainView().Title = "Patch"
if gui.currentViewName() == "commitFiles" {
gui.handleEscapeLineByLinePanel()
}
commitFile := gui.getSelectedCommitFile()
if commitFile == nil {
+ // TODO: consider making it so that we can also render strings to our own view through some common interface, or just render this to the main view for consistency
gui.renderString("commitFiles", gui.Tr.SLocalize("NoCommiteFiles"))
return nil
}
- if err := gui.refreshSecondaryPatchPanel(); err != nil {
- return err
- }
-
cmd := gui.OSCommand.ExecutableFromString(
gui.GitCommand.ShowCommitFileCmdStr(commitFile.Sha, commitFile.Name, false),
)
- if err := gui.newPtyTask("main", cmd); err != nil {
- gui.Log.Error(err)
- }
+ task := gui.createRunPtyTask(cmd)
- return nil
+ return gui.refreshMain(refreshMainOpts{
+ main: &viewUpdateOpts{
+ title: "Patch",
+ task: task,
+ },
+ secondary: gui.secondaryPatchPanelUpdateOpts(),
+ })
}
func (gui *Gui) handleSwitchToCommitsPanel(g *gocui.Gui, v *gocui.View) error {