From c6f6498cc979b341c0deb82e968b8d23531c0393 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sat, 24 Apr 2021 13:42:42 -0700 Subject: [PATCH] conflicts: add newline after conflict marker lines Merging is currently done with line-level granularity, so it makes sense to have newlines after the markers. That makes them easier to edit out when resolving conflicts. --- lib/src/conflicts.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/conflicts.rs b/lib/src/conflicts.rs index 46cdcff7c..db46b89a7 100644 --- a/lib/src/conflicts.rs +++ b/lib/src/conflicts.rs @@ -77,13 +77,13 @@ pub fn materialize_conflict( file.write_all(&contents).unwrap(); } files::MergeHunk::Conflict { base, left, right } => { - file.write_all(b"<<<<<<<").unwrap(); + file.write_all(b"<<<<<<<\n").unwrap(); file.write_all(&left).unwrap(); - file.write_all(b"|||||||").unwrap(); + file.write_all(b"|||||||\n").unwrap(); file.write_all(&base).unwrap(); - file.write_all(b"=======").unwrap(); + file.write_all(b"=======\n").unwrap(); file.write_all(&right).unwrap(); - file.write_all(b">>>>>>>").unwrap(); + file.write_all(b">>>>>>>\n").unwrap(); } } }