feature<TextDiffView>: supports line staging/unstaging in working copy diff view

This commit is contained in:
leo 2024-02-27 21:13:52 +08:00
parent 91ef4e44a4
commit 671e46f8b3
10 changed files with 443 additions and 46 deletions

View file

@ -18,16 +18,19 @@ namespace SourceGit.Models {
public class TextDiffLine {
public TextDiffLineType Type { get; set; } = TextDiffLineType.None;
public string Content { get; set; } = "";
public string OldLine { get; set; } = "";
public string NewLine { get; set; } = "";
public int OldLineNumber { get; set; } = 0;
public int NewLineNumber { get; set; } = 0;
public List<TextInlineRange> Highlights { get; set; } = new List<TextInlineRange>();
public string OldLine => OldLineNumber == 0 ? string.Empty : OldLineNumber.ToString();
public string NewLine => NewLineNumber == 0 ? string.Empty : NewLineNumber.ToString();
public TextDiffLine() { }
public TextDiffLine(TextDiffLineType type, string content, string oldLine, string newLine) {
public TextDiffLine(TextDiffLineType type, string content, int oldLine, int newLine) {
Type = type;
Content = content;
OldLine = oldLine;
NewLine = newLine;
OldLineNumber = oldLine;
NewLineNumber = newLine;
}
}