From 85b83990a80936138ba07697edde8580e1960a4c Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 25 Sep 2024 16:24:04 +0800 Subject: [PATCH] code_style: run `dotnet format` --- src/Converters/PathConverters.cs | 2 +- src/Models/Statistics.cs | 5 +++-- src/Models/TextMateHelper.cs | 8 ++++---- src/ViewModels/Launcher.cs | 2 +- src/Views/ChangeCollectionView.axaml.cs | 12 ++++++------ src/Views/RevisionFileTreeView.axaml.cs | 2 +- src/Views/Welcome.axaml.cs | 4 ++-- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/Converters/PathConverters.cs b/src/Converters/PathConverters.cs index 95da6c79..dd7cfa49 100644 --- a/src/Converters/PathConverters.cs +++ b/src/Converters/PathConverters.cs @@ -18,7 +18,7 @@ namespace SourceGit.Converters { if (OperatingSystem.IsWindows()) return v; - + var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); var prefixLen = home.EndsWith('/') ? home.Length - 1 : home.Length; if (v.StartsWith(home, StringComparison.Ordinal)) diff --git a/src/Models/Statistics.cs b/src/Models/Statistics.cs index 8335ec6b..b669eb55 100644 --- a/src/Models/Statistics.cs +++ b/src/Models/Statistics.cs @@ -43,12 +43,13 @@ namespace SourceGit.Models { _mode = mode; - YAxes = [new Axis() { + YAxes = [new Axis() + { TextSize = 10, MinLimit = 0, SeparatorsPaint = new SolidColorPaint(new SKColor(0x40808080)) { StrokeThickness = 1 } }]; - + if (mode == StaticsticsMode.ThisWeek) { for (int i = 0; i < 7; i++) diff --git a/src/Models/TextMateHelper.cs b/src/Models/TextMateHelper.cs index f8e5acf2..2e38e4dd 100644 --- a/src/Models/TextMateHelper.cs +++ b/src/Models/TextMateHelper.cs @@ -38,7 +38,7 @@ namespace SourceGit.Models extension = ".sh"; else if (extension == ".kt" || extension == ".kts") extension = ".kotlin"; - + foreach (var grammar in s_extraGrammars) { if (grammar.Extension.Equals(extension, StringComparison.OrdinalIgnoreCase)) @@ -87,7 +87,7 @@ namespace SourceGit.Models public ICollection GetInjections(string scopeName) => _backend.GetInjections(scopeName); public IRawGrammar GetGrammar(string scopeName) => GrammarUtility.GetGrammar(scopeName, _backend); public string GetScope(string filename) => GrammarUtility.GetScope(filename, _backend); - + private readonly RegistryOptions _backend = new(defaultTheme); } @@ -95,8 +95,8 @@ namespace SourceGit.Models { public static TextMate.Installation CreateForEditor(TextEditor editor) { - return editor.InstallTextMate(Application.Current?.ActualThemeVariant == ThemeVariant.Dark ? - new RegistryOptionsWrapper(ThemeName.DarkPlus) : + return editor.InstallTextMate(Application.Current?.ActualThemeVariant == ThemeVariant.Dark ? + new RegistryOptionsWrapper(ThemeName.DarkPlus) : new RegistryOptionsWrapper(ThemeName.LightPlus)); } diff --git a/src/ViewModels/Launcher.cs b/src/ViewModels/Launcher.cs index 06a06547..17234cec 100644 --- a/src/ViewModels/Launcher.cs +++ b/src/ViewModels/Launcher.cs @@ -32,7 +32,7 @@ namespace SourceGit.ViewModels { PopupHost.Active = value; - if (!_ignoreIndexChange && value is { Data: Repository repo}) + if (!_ignoreIndexChange && value is { Data: Repository repo }) ActiveWorkspace.ActiveIdx = ActiveWorkspace.Repositories.IndexOf(repo.FullPath); } } diff --git a/src/Views/ChangeCollectionView.axaml.cs b/src/Views/ChangeCollectionView.axaml.cs index 39d46d77..a47988f0 100644 --- a/src/Views/ChangeCollectionView.axaml.cs +++ b/src/Views/ChangeCollectionView.axaml.cs @@ -41,7 +41,7 @@ namespace SourceGit.Views e.Handled = true; } } - + if (!e.Handled && e.Key != Key.Space) base.OnKeyDown(e); } @@ -166,10 +166,10 @@ namespace SourceGit.Views { if (lastUnselected == -1) continue; - + break; } - + lastUnselected = i; } } @@ -186,10 +186,10 @@ namespace SourceGit.Views { if (lastUnselected == -1) continue; - + break; } - + lastUnselected = i; } @@ -244,7 +244,7 @@ namespace SourceGit.Views _disableSelectionChangingEvent = true; var selected = new List(); - if (sender is ListBox { SelectedItems: {} selectedItems }) + if (sender is ListBox { SelectedItems: { } selectedItems }) { foreach (var item in selectedItems) { diff --git a/src/Views/RevisionFileTreeView.axaml.cs b/src/Views/RevisionFileTreeView.axaml.cs index 09e2159e..a6e8df41 100644 --- a/src/Views/RevisionFileTreeView.axaml.cs +++ b/src/Views/RevisionFileTreeView.axaml.cs @@ -117,7 +117,7 @@ namespace SourceGit.Views e.Handled = true; } } - + if (!e.Handled) base.OnKeyDown(e); } diff --git a/src/Views/Welcome.axaml.cs b/src/Views/Welcome.axaml.cs index db4e0392..a8045aa9 100644 --- a/src/Views/Welcome.axaml.cs +++ b/src/Views/Welcome.axaml.cs @@ -25,7 +25,7 @@ namespace SourceGit.Views e.Handled = true; } } - + public class RepositoryListBox : ListBox { protected override Type StyleKeyOverride => typeof(ListBox); @@ -40,7 +40,7 @@ namespace SourceGit.Views e.Handled = true; } } - + if (!e.Handled) base.OnKeyDown(e); }