Skip to content

Commit 962055d

Browse files
committed
code_style: run dotnet format
Signed-off-by: leo <[email protected]>
1 parent 723263d commit 962055d

File tree

4 files changed

+25
-24
lines changed

4 files changed

+25
-24
lines changed

src/ViewModels/BlockNavigation.cs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ public string Indicator
4040
{
4141
if (Blocks.Count == 0)
4242
return "-/-";
43-
43+
4444
if (_current >= 0 && _current < Blocks.Count)
45-
return $"{_current+1}/{Blocks.Count}";
45+
return $"{_current + 1}/{Blocks.Count}";
4646

4747
return $"-/{Blocks.Count}";
4848
}
4949
}
50-
50+
5151
public BlockNavigation(object context)
5252
{
5353
Blocks.Clear();
5454
Current = -1;
55-
55+
5656
var lines = new List<Models.TextDiffLine>();
5757
if (context is Models.TextDiff combined)
5858
lines = combined.Lines;
@@ -61,12 +61,12 @@ public BlockNavigation(object context)
6161

6262
if (lines.Count == 0)
6363
return;
64-
64+
6565
var lineIdx = 0;
6666
var blockStartIdx = 0;
6767
var isNewBlock = true;
6868
var blocks = new List<Block>();
69-
69+
7070
foreach (var line in lines)
7171
{
7272
lineIdx++;
@@ -89,7 +89,7 @@ public BlockNavigation(object context)
8989
}
9090
}
9191
}
92-
92+
9393
if (!isNewBlock)
9494
blocks.Add(new Block(blockStartIdx, lines.Count - 1));
9595

@@ -103,16 +103,18 @@ public Block GetCurrentBlock()
103103

104104
public Block GotoNext()
105105
{
106-
if (Blocks.Count == 0) return null;
107-
106+
if (Blocks.Count == 0)
107+
return null;
108+
108109
Current = (_current + 1) % Blocks.Count;
109110
return Blocks[_current];
110111
}
111112

112113
public Block GotoPrev()
113114
{
114-
if (Blocks.Count == 0) return null;
115-
115+
if (Blocks.Count == 0)
116+
return null;
117+
116118
Current = _current == -1 ? Blocks.Count - 1 : (_current - 1 + Blocks.Count) % Blocks.Count;
117119
return Blocks[_current];
118120
}

src/ViewModels/CommitDetail.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public string RevisionFileSearchFilter
121121
if (SetProperty(ref _revisionFileSearchFilter, value))
122122
{
123123
RevisionFileSearchSuggestion.Clear();
124-
124+
125125
if (!string.IsNullOrEmpty(value))
126126
{
127127
if (_revisionFiles.Count == 0)
@@ -132,7 +132,8 @@ public string RevisionFileSearchFilter
132132
{
133133
var files = new Commands.QueryRevisionFileNames(_repo.FullPath, sha).Result();
134134

135-
Dispatcher.UIThread.Invoke(() => {
135+
Dispatcher.UIThread.Invoke(() =>
136+
{
136137
if (sha == Commit.SHA)
137138
{
138139
_revisionFiles.Clear();
@@ -795,7 +796,7 @@ private void UpdateRevisionFileSearchSuggestion()
795796
var suggestion = new List<string>();
796797
foreach (var file in _revisionFiles)
797798
{
798-
if (file.Contains(_revisionFileSearchFilter, StringComparison.OrdinalIgnoreCase) &&
799+
if (file.Contains(_revisionFileSearchFilter, StringComparison.OrdinalIgnoreCase) &&
799800
file.Length != _revisionFileSearchFilter.Length)
800801
suggestion.Add(file);
801802

src/Views/RepositoryToolbar.axaml.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
31
using Avalonia.Controls;
42
using Avalonia.Input;
53
using Avalonia.Interactivity;

src/Views/TextDiffView.axaml.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ public void GotoPrevChange()
557557

558558
return;
559559
}
560-
560+
561561
var firstLineIdx = DisplayRange.StartIdx;
562562
if (firstLineIdx <= 1)
563563
return;
@@ -600,7 +600,7 @@ public void GotoPrevChange()
600600
}
601601

602602
public void GotoNextChange()
603-
{
603+
{
604604
var blockNavigation = BlockNavigation;
605605
if (blockNavigation != null)
606606
{
@@ -613,7 +613,7 @@ public void GotoNextChange()
613613

614614
return;
615615
}
616-
616+
617617
var lines = GetLines();
618618
var lastLineIdx = DisplayRange.EndIdx;
619619
if (lastLineIdx >= lines.Count - 1)
@@ -724,7 +724,7 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
724724
oldValue.PropertyChanged -= OnBlockNavigationPropertyChanged;
725725
if (newValue != null)
726726
newValue.PropertyChanged += OnBlockNavigationPropertyChanged;
727-
727+
728728
InvalidateVisual();
729729
}
730730
}
@@ -1557,7 +1557,7 @@ public ViewModels.BlockNavigation BlockNavigation
15571557
get => GetValue(BlockNavigationProperty);
15581558
set => SetValue(BlockNavigationProperty, value);
15591559
}
1560-
1560+
15611561
public static readonly StyledProperty<string> BlockNavigationIndicatorProperty =
15621562
AvaloniaProperty.Register<TextDiffView, string>(nameof(BlockNavigationIndicator));
15631563

@@ -1599,7 +1599,7 @@ public TextDiffView()
15991599
{
16001600
InitializeComponent();
16011601
}
1602-
1602+
16031603
public void GotoPrevChange()
16041604
{
16051605
var presenter = this.FindDescendantOfType<ThemedTextDiffPresenter>();
@@ -1609,7 +1609,7 @@ public void GotoPrevChange()
16091609
presenter.GotoPrevChange();
16101610
if (presenter is SingleSideTextDiffPresenter singleSide)
16111611
singleSide.ForceSyncScrollOffset();
1612-
1612+
16131613
BlockNavigationIndicator = BlockNavigation?.Indicator ?? string.Empty;
16141614
}
16151615

@@ -1622,7 +1622,7 @@ public void GotoNextChange()
16221622
presenter.GotoNextChange();
16231623
if (presenter is SingleSideTextDiffPresenter singleSide)
16241624
singleSide.ForceSyncScrollOffset();
1625-
1625+
16261626
BlockNavigationIndicator = BlockNavigation?.Indicator ?? string.Empty;
16271627
}
16281628

0 commit comments

Comments
 (0)