feat: show git file mode change if exist

This commit is contained in:
Gadfly 2024-04-12 21:38:36 +08:00
parent 2d5e048797
commit a249eed1ac
No known key found for this signature in database
GPG key ID: 9128145F93CFC69C
7 changed files with 61 additions and 2 deletions

View file

@ -7,6 +7,7 @@ using Avalonia.Media.Imaging;
using Avalonia.Threading;
using CommunityToolkit.Mvvm.ComponentModel;
using SourceGit.Models;
namespace SourceGit.ViewModels
{
@ -66,6 +67,12 @@ namespace SourceGit.ViewModels
set => SetProperty(ref _syncScrollOffset, value);
}
public Models.FileModeDiff FileModeDiff
{
get => _fileModeDiff;
set => SetProperty(ref _fileModeDiff, value);
}
public DiffContext(string repo, Models.DiffOption option, DiffContext previous = null)
{
_repo = repo;
@ -86,6 +93,11 @@ namespace SourceGit.ViewModels
var latest = new Commands.Diff(repo, option).Result();
var rs = null as object;
if (latest.FileModeDiff != null)
{
FileModeDiff = latest.FileModeDiff;
}
if (latest.TextDiff != null)
{
latest.TextDiff.File = _option.Path;
@ -180,5 +192,6 @@ namespace SourceGit.ViewModels
private bool _isTextDiff = false;
private object _content = null;
private Vector _syncScrollOffset = Vector.Zero;
private Models.FileModeDiff _fileModeDiff = null;
}
}