optimize<DiffViewer>: ignore "No new line at end of file" in diff outputs; add IsContent and IsDifference methods for ChangeBlock

This commit is contained in:
leo 2020-11-27 12:45:30 +08:00
parent 06b5709a05
commit aaefaf5b06
2 changed files with 20 additions and 8 deletions

View file

@ -98,7 +98,7 @@ namespace SourceGit.Git {
rs.Lines.Add(new LineChange(LineMode.Added, line.Substring(1), "", $"{newLine}"));
newLine++;
} else if (line[0] == '\\') {
rs.Lines.Add(new LineChange(LineMode.Indicator, line.Substring(1)));
// IGNORE \ No new line end of file.
} else {
var match = REG_INDICATOR.Match(line);
if (match.Success) {