Hack for conflict marker

This commit is contained in:
Rene Pfeuffer
2020-01-08 12:58:13 +01:00
parent b261709b52
commit cf96b1b998
3 changed files with 21 additions and 1 deletions

View File

@@ -173,6 +173,18 @@ class DiffFile extends React.Component<Props, State> {
};
renderHunk = (hunk: HunkType, i: number) => {
let inConflict = false;
for (i = 0; i < hunk.changes.length; ++i) {
if (hunk.changes[i].content === "<<<<<<< HEAD") {
inConflict = true;
}
if (inConflict) {
hunk.changes[i].type = "conflict";
}
if (hunk.changes[i].content.startsWith(">>>>>>>")) {
inConflict = false;
}
}
return [
<Decoration key={"decoration-" + hunk.content}>{this.createHunkHeader(hunk, i)}</Decoration>,
<Hunk