Bugfix: Diff

This commit is contained in:
Tobias Hößl 2019-03-17 20:31:25 +01:00
parent 6cb4b9a691
commit 5d9128403a
No known key found for this signature in database
GPG Key ID: 1D780C7599C2D2A2

View File

@ -110,7 +110,6 @@ export class MotionSlideComponent extends BaseMotionSlideComponent<MotionSlideDa
}
const origText = baseParagraphs[paraNo],
paragraphLines = this.lineNumbering.getLineNumberRange(origText),
diff = this.diff.diff(origText, newText),
affectedLines = this.diff.detectAffectedLineRange(diff);
@ -118,18 +117,12 @@ export class MotionSlideComponent extends BaseMotionSlideComponent<MotionSlideDa
return null;
}
let newTextLines = this.lineNumbering.insertLineNumbers(
newText,
this.lineLength,
null,
null,
paragraphLines.from
);
newTextLines = this.diff.formatDiff(
this.diff.extractRangeByLineNumbers(newTextLines, affectedLines.from, affectedLines.to)
const affectedDiff = this.diff.formatDiff(
this.diff.extractRangeByLineNumbers(diff, affectedLines.from, affectedLines.to)
);
const affectedConsolidated = this.diff.diffHtmlToFinalText(affectedDiff);
return new MotionSlideObjAmendmentParagraph(amendment, paraNo, newTextLines, affectedLines);
return new MotionSlideObjAmendmentParagraph(amendment, paraNo, affectedConsolidated, affectedLines);
}
)
.filter((para: MotionSlideObjAmendmentParagraph) => para !== null);