summaryrefslogtreecommitdiffstats
path: root/pkg/gui/commit_files_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-22 09:22:22 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commit26f80087dd837e152a72ce2b3de374b7becbdd5b (patch)
tree399baba7d4c13f99bc16068f2d6550c4bb51ec0f /pkg/gui/commit_files_panel.go
parent0ac402792bd184965441b6ac60d054ae7d0afd7b (diff)
when toggling files reset patch manager if patch ends up empty
Diffstat (limited to 'pkg/gui/commit_files_panel.go')
-rw-r--r--pkg/gui/commit_files_panel.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/gui/commit_files_panel.go b/pkg/gui/commit_files_panel.go
index 55a2bde52..6e3cd4b1f 100644
--- a/pkg/gui/commit_files_panel.go
+++ b/pkg/gui/commit_files_panel.go
@@ -141,6 +141,10 @@ func (gui *Gui) handleToggleFileForPatch(g *gocui.Gui, v *gocui.View) error {
gui.GitCommand.PatchManager.ToggleFileWhole(commitFile.Name)
+ if gui.GitCommand.PatchManager.IsEmpty() {
+ gui.GitCommand.PatchManager.Reset()
+ }
+
return gui.refreshCommitFilesView()
}