summaryrefslogtreecommitdiffstats
path: root/pkg/gui/diffing.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/diffing.go')
-rw-r--r--pkg/gui/diffing.go28
1 files changed, 15 insertions, 13 deletions
diff --git a/pkg/gui/diffing.go b/pkg/gui/diffing.go
index 7418cf3aa..4e88f2e8b 100644
--- a/pkg/gui/diffing.go
+++ b/pkg/gui/diffing.go
@@ -18,20 +18,22 @@ func (gui *Gui) exitDiffMode() error {
}
func (gui *Gui) renderDiff() error {
- gui.getMainView().Title = "Diff"
- gui.splitMainPanel(false)
- filterArg := ""
- if gui.inFilterMode() {
- filterArg = fmt.Sprintf(" -- %s", gui.State.FilterPath)
- }
+ return gui.refreshMain(refreshMainOpts{
+ main: &viewUpdateOpts{
+ title: "Diff",
+ task: func() error {
+ filterArg := ""
+ if gui.inFilterMode() {
+ filterArg = fmt.Sprintf(" -- %s", gui.State.FilterPath)
+ }
- cmd := gui.OSCommand.ExecutableFromString(
- fmt.Sprintf("git diff --color %s %s", gui.diffStr(), filterArg),
- )
- if err := gui.newPtyTask("main", cmd); err != nil {
- gui.Log.Error(err)
- }
- return nil
+ cmd := gui.OSCommand.ExecutableFromString(
+ fmt.Sprintf("git diff --color %s %s", gui.diffStr(), filterArg),
+ )
+ return gui.newPtyTask("main", cmd)
+ },
+ },
+ })
}
// currentDiffTerminals returns the current diff terminals of the currently selected item.