enhance: revision file viewer

- show current file path
- add a toggle button to use global syntax highlighting setting (sometimes TextMateSharp will crash this app)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-06-06 10:07:58 +08:00
parent f003f67129
commit ac55bed812
No known key found for this signature in database
5 changed files with 71 additions and 17 deletions

View file

@ -105,10 +105,16 @@ namespace SourceGit.ViewModels
}
}
public string ViewRevisionFilePath
{
get => _viewRevisionFilePath;
private set => SetProperty(ref _viewRevisionFilePath, value);
}
public object ViewRevisionFileContent
{
get => _viewRevisionFileContent;
set => SetProperty(ref _viewRevisionFileContent, value);
private set => SetProperty(ref _viewRevisionFileContent, value);
}
public string RevisionFileSearchFilter
@ -189,10 +195,13 @@ namespace SourceGit.ViewModels
{
if (file == null)
{
ViewRevisionFilePath = string.Empty;
ViewRevisionFileContent = null;
return;
}
ViewRevisionFilePath = file.Path;
switch (file.Type)
{
case Models.ObjectType.Blob:
@ -893,6 +902,7 @@ namespace SourceGit.ViewModels
private List<Models.Change> _selectedChanges = null;
private string _searchChangeFilter = string.Empty;
private DiffContext _diffContext = null;
private string _viewRevisionFilePath = string.Empty;
private object _viewRevisionFileContent = null;
private CancellationTokenSource _cancellationSource = null;
private bool _requestingRevisionFiles = false;