diff options
author | Ryooooooga <eial5q265e5@gmail.com> | 2021-08-24 21:33:19 +0900 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-08-25 22:23:55 +1000 |
commit | 6ca42ff72081624fc05be571d75ab71dd1d9bf6b (patch) | |
tree | 86bb55feba07d3903dd1fafecf57eec516cc3a4d /pkg/gui/mergeconflicts | |
parent | a533f8e1a5bae8cd0cad12555d45fbf04ddc42c6 (diff) |
Fix `pick all hunks`
Diffstat (limited to 'pkg/gui/mergeconflicts')
-rw-r--r-- | pkg/gui/mergeconflicts/state.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/gui/mergeconflicts/state.go b/pkg/gui/mergeconflicts/state.go index 69d90d573..da2f628a6 100644 --- a/pkg/gui/mergeconflicts/state.go +++ b/pkg/gui/mergeconflicts/state.go @@ -22,7 +22,7 @@ const ( TOP Selection = iota MIDDLE BOTTOM - BOTH + ALL ) // mergeConflict : A git conflict with a start, ancestor (if exists), target, and end corresponding to line @@ -179,6 +179,12 @@ func isIndexToDelete(i int, conflict *mergeConflict, selection Selection) bool { return false } + isMarkerLine := + i == conflict.start || + i == conflict.ancestor || + i == conflict.target || + i == conflict.end + var isWantedContent bool switch selection { case TOP: @@ -191,7 +197,9 @@ func isIndexToDelete(i int, conflict *mergeConflict, selection Selection) bool { isWantedContent = conflict.ancestor < i && i < conflict.target case BOTTOM: isWantedContent = conflict.target < i && i < conflict.end + case ALL: + isWantedContent = true } - return !isWantedContent + return isMarkerLine || !isWantedContent } |