mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
Hack for conflict marker
This commit is contained in:
@@ -173,6 +173,18 @@ class DiffFile extends React.Component<Props, State> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
renderHunk = (hunk: HunkType, i: number) => {
|
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 [
|
return [
|
||||||
<Decoration key={"decoration-" + hunk.content}>{this.createHunkHeader(hunk, i)}</Decoration>,
|
<Decoration key={"decoration-" + hunk.content}>{this.createHunkHeader(hunk, i)}</Decoration>,
|
||||||
<Hunk
|
<Hunk
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export type Hunk = {
|
|||||||
content: string;
|
content: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ChangeType = "insert" | "delete" | "normal";
|
export type ChangeType = "insert" | "delete" | "normal" | "conflict";
|
||||||
|
|
||||||
export type Change = {
|
export type Change = {
|
||||||
content: string;
|
content: string;
|
||||||
|
|||||||
@@ -829,4 +829,12 @@ form .field:not(.is-grouped) {
|
|||||||
font-weight: 500 !important;
|
font-weight: 500 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.diff-gutter-conflict {
|
||||||
|
background: $warning-50;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diff-code-conflict {
|
||||||
|
background: $warning-25;
|
||||||
|
}
|
||||||
|
|
||||||
@import "bulma-popover/css/bulma-popover";
|
@import "bulma-popover/css/bulma-popover";
|
||||||
|
|||||||
Reference in New Issue
Block a user