diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-22 16:06:09 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | c837c54c39d4e15af3f26df646f550436b35d505 (patch) | |
tree | 148535b6e990f2088ad5d83c877676e410c3181d /pkg/gui/diffing.go | |
parent | 5874529f4310c6b4b0abdfcef714ff6f6cc8afd5 (diff) |
handle diffing and filtering by file in commit files view
Diffstat (limited to 'pkg/gui/diffing.go')
-rw-r--r-- | pkg/gui/diffing.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/pkg/gui/diffing.go b/pkg/gui/diffing.go index 06d19959c..b92323ad4 100644 --- a/pkg/gui/diffing.go +++ b/pkg/gui/diffing.go @@ -13,14 +13,8 @@ func (gui *Gui) exitDiffMode() error { } func (gui *Gui) renderDiff() error { - filterArg := "" - - if gui.State.Modes.Filtering.Active() { - filterArg = fmt.Sprintf(" -- %s", gui.State.Modes.Filtering.Path) - } - cmd := gui.OSCommand.ExecutableFromString( - fmt.Sprintf("git diff --color %s %s", gui.diffStr(), filterArg), + fmt.Sprintf("git diff --color %s", gui.diffStr()), ) task := gui.createRunPtyTask(cmd) @@ -100,6 +94,8 @@ func (gui *Gui) diffStr() string { file := gui.currentlySelectedFilename() if file != "" { output += " -- " + file + } else if gui.State.Modes.Filtering.Active() { + output += " -- " + gui.State.Modes.Filtering.Path } return output |