diff options
author | Ryooooooga <eial5q265e5@gmail.com> | 2021-08-22 01:03:15 +0900 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-08-25 22:23:55 +1000 |
commit | 73548fa15fe6f65b6a4c35c03402865145c0e107 (patch) | |
tree | 5413520e7080856f4deba1f17fa92094d5a21277 /pkg/gui/mergeconflicts | |
parent | a0e7604f61f19f829f76966fb3f97cab09307ab1 (diff) |
Fix conflict resolution
Diffstat (limited to 'pkg/gui/mergeconflicts')
-rw-r--r-- | pkg/gui/mergeconflicts/state.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pkg/gui/mergeconflicts/state.go b/pkg/gui/mergeconflicts/state.go index 343f282ad..1eea08cb0 100644 --- a/pkg/gui/mergeconflicts/state.go +++ b/pkg/gui/mergeconflicts/state.go @@ -156,11 +156,9 @@ func (s *State) ContentAfterConflictResolve(path string, selection Selection) (b } func isIndexToDelete(i int, conflict *mergeConflict, selection Selection) bool { - isMarkerLine := - i == conflict.start || - i == conflict.ancestor || - i == conflict.target || - i == conflict.end + if i < conflict.start || conflict.end < i { + return false + } var isWantedContent bool switch selection { @@ -175,5 +173,6 @@ func isIndexToDelete(i int, conflict *mergeConflict, selection Selection) bool { case BOTTOM: isWantedContent = conflict.target < i && i < conflict.end } - return isMarkerLine || !isWantedContent + + return !isWantedContent } |