code_style: run dotnet format

This commit is contained in:
leo 2024-06-14 09:46:30 +08:00
parent 1dffb2ebf5
commit 9d3f186b44
No known key found for this signature in database
GPG key ID: B528468E49CD0E58
10 changed files with 17 additions and 16 deletions

View file

@ -12,7 +12,8 @@ namespace SourceGit.Commands
public string Result() public string Result()
{ {
var rs = ReadToEnd(); var rs = ReadToEnd();
if (rs.IsSuccess) return rs.StdOut.TrimEnd(); if (rs.IsSuccess)
return rs.StdOut.TrimEnd();
return string.Empty; return string.Empty;
} }
} }

View file

@ -58,7 +58,7 @@ namespace SourceGit.Commands
} }
nextPartIdx++; nextPartIdx++;
start = end + 1; start = end + 1;
end = rs.StdOut.IndexOf('\n', start); end = rs.StdOut.IndexOf('\n', start);
} }

View file

@ -1,6 +1,6 @@
using System; using System;
using System.Text.Json.Serialization;
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Serialization;
using Avalonia.Controls; using Avalonia.Controls;

View file

@ -442,7 +442,7 @@ namespace SourceGit.ViewModels
else else
{ {
visible = new Commands.QueryCommits(FullPath, $"-1000 -- \"{_searchCommitFilter}\"", false).Result(); visible = new Commands.QueryCommits(FullPath, $"-1000 -- \"{_searchCommitFilter}\"", false).Result();
} }
SearchedCommits = visible; SearchedCommits = visible;
} }
@ -1002,7 +1002,7 @@ namespace SourceGit.ViewModels
menu.Items.Add(new MenuItem() { Header = "-" }); menu.Items.Add(new MenuItem() { Header = "-" });
menu.Items.Add(compareWithBranch); menu.Items.Add(compareWithBranch);
} }
} }
var type = GitFlow.GetBranchType(branch.Name); var type = GitFlow.GetBranchType(branch.Name);

View file

@ -24,7 +24,7 @@ namespace SourceGit.ViewModels
_repo = repo; _repo = repo;
_oldMessage = new Commands.QueryCommitFullMessage(_repo.FullPath, head.SHA).Result(); _oldMessage = new Commands.QueryCommitFullMessage(_repo.FullPath, head.SHA).Result();
_message = _oldMessage; _message = _oldMessage;
Head = head; Head = head;
View = new Views.Reword() { DataContext = this }; View = new Views.Reword() { DataContext = this };
} }

View file

@ -28,7 +28,7 @@ namespace SourceGit.ViewModels
{ {
_repo = repo; _repo = repo;
_message = new Commands.QueryCommitFullMessage(_repo.FullPath, parent.SHA).Result(); _message = new Commands.QueryCommitFullMessage(_repo.FullPath, parent.SHA).Result();
Head = head; Head = head;
Parent = parent; Parent = parent;
View = new Views.Squash() { DataContext = this }; View = new Views.Squash() { DataContext = this };

View file

@ -14,7 +14,7 @@ namespace SourceGit.Views
get => GetValue(CanNavigateProperty); get => GetValue(CanNavigateProperty);
set => SetValue(CanNavigateProperty, value); set => SetValue(CanNavigateProperty, value);
} }
public static readonly StyledProperty<string> MessageProperty = public static readonly StyledProperty<string> MessageProperty =
AvaloniaProperty.Register<CommitBaseInfo, string>(nameof(Message), string.Empty); AvaloniaProperty.Register<CommitBaseInfo, string>(nameof(Message), string.Empty);

View file

@ -184,12 +184,12 @@ namespace SourceGit.Views
var visual = (Visual)e.Source; var visual = (Visual)e.Source;
BeginMoveDrag(new PointerPressedEventArgs( BeginMoveDrag(new PointerPressedEventArgs(
e.Source, e.Source,
e.Pointer, e.Pointer,
visual, visual,
e.GetPosition(visual), e.GetPosition(visual),
e.Timestamp, e.Timestamp,
new PointerPointProperties(RawInputModifiers.None, PointerUpdateKind.LeftButtonPressed), new PointerPointProperties(RawInputModifiers.None, PointerUpdateKind.LeftButtonPressed),
e.KeyModifiers)); e.KeyModifiers));
} }

View file

@ -116,7 +116,7 @@ namespace SourceGit.Views
{ {
SelectedObject = null; SelectedObject = null;
detail.ViewRevisionFile(null); detail.ViewRevisionFile(null);
} }
} }
}; };

View file

@ -107,7 +107,7 @@ namespace SourceGit.Views
protected override Type StyleKeyOverride => typeof(TextEditor); protected override Type StyleKeyOverride => typeof(TextEditor);
public IThemedTextDiffPresenter(TextArea area, TextDocument doc): base(area, doc) public IThemedTextDiffPresenter(TextArea area, TextDocument doc) : base(area, doc)
{ {
IsReadOnly = true; IsReadOnly = true;
ShowLineNumbers = false; ShowLineNumbers = false;
@ -156,7 +156,7 @@ namespace SourceGit.Views
TextArea.TextView.LineTransformers.Remove(_lineStyleTransformer); TextArea.TextView.LineTransformers.Remove(_lineStyleTransformer);
_textMate = Models.TextMateHelper.CreateForEditor(this); _textMate = Models.TextMateHelper.CreateForEditor(this);
TextArea.TextView.LineTransformers.Add(_lineStyleTransformer); TextArea.TextView.LineTransformers.Add(_lineStyleTransformer);
Models.TextMateHelper.SetGrammarByFileName(_textMate, FileName); Models.TextMateHelper.SetGrammarByFileName(_textMate, FileName);
} }
} }
else else