Skip to content

Commit 553b157

Browse files
committed
code_style: remove Rider warnings
Signed-off-by: leo <[email protected]>
1 parent 5f2984f commit 553b157

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/Views/TextDiffView.axaml.cs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ protected override void OnDataContextChanged(EventArgs e)
121121
InvalidateMeasure();
122122
}
123123

124-
private readonly bool _usePresenter = false;
125-
private readonly bool _isOld = false;
124+
private readonly bool _usePresenter;
125+
private readonly bool _isOld;
126126
}
127127

128128
public class LineModifyTypeMargin : AbstractMargin
@@ -307,7 +307,7 @@ private IBrush GetBrushByLineType(Models.TextDiffLineType type)
307307
};
308308
}
309309

310-
private readonly ThemedTextDiffPresenter _presenter = null;
310+
private readonly ThemedTextDiffPresenter _presenter;
311311
}
312312

313313
public class LineStyleTransformer(ThemedTextDiffPresenter presenter) : DocumentColorizingTransformer
@@ -480,7 +480,7 @@ public ThemedTextDiffPresenter(TextArea area, TextDocument doc) : base(area, doc
480480

481481
public void GotoChange(ViewModels.BlockNavigationDirection direction)
482482
{
483-
if (DataContext is not ViewModels.TextDiffContext ctx)
483+
if (DataContext is not ViewModels.TextDiffContext)
484484
return;
485485

486486
var block = BlockNavigation.Goto(direction);
@@ -871,11 +871,11 @@ private async Task CopyWithoutIndicatorsAsync()
871871
await App.CopyTextAsync(builder.ToString());
872872
}
873873

874-
private bool _execSizeChanged = false;
875-
private TextMate.Installation _textMate = null;
874+
private bool _execSizeChanged;
875+
private TextMate.Installation _textMate;
876876
private TextLocation _lastSelectStart = TextLocation.Empty;
877877
private TextLocation _lastSelectEnd = TextLocation.Empty;
878-
private LineStyleTransformer _lineStyleTransformer = null;
878+
private LineStyleTransformer _lineStyleTransformer;
879879
}
880880

881881
public class CombinedTextDiffPresenter : ThemedTextDiffPresenter
@@ -1049,7 +1049,7 @@ private void OnTextViewScrollChanged(object sender, ScrollChangedEventArgs e)
10491049
TrySetChunk(null);
10501050
}
10511051

1052-
private ScrollViewer _scrollViewer = null;
1052+
private ScrollViewer _scrollViewer;
10531053
}
10541054

10551055
public class SingleSideTextDiffPresenter : ThemedTextDiffPresenter
@@ -1257,7 +1257,7 @@ private void OnBlockNavigationPropertyChanged(object sender, PropertyChangedEven
12571257
TextArea?.TextView?.Redraw();
12581258
}
12591259

1260-
private ScrollViewer _scrollViewer = null;
1260+
private ScrollViewer _scrollViewer;
12611261
}
12621262

12631263
public class TextDiffViewMinimap : Control
@@ -1356,10 +1356,9 @@ protected override void OnPointerPressed(PointerPressedEventArgs e)
13561356
if (range == null || range.End == 0)
13571357
return;
13581358

1359-
var total = 0;
1359+
int total;
13601360
if (DataContext is ViewModels.TwoSideTextDiff twoSideDiff)
13611361
{
1362-
var halfWidth = Bounds.Width * 0.5;
13631362
total = Math.Max(twoSideDiff.Old.Count, twoSideDiff.New.Count);
13641363
}
13651364
else if (DataContext is ViewModels.CombinedTextDiff combined)
@@ -1380,7 +1379,7 @@ protected override void OnPointerPressed(PointerPressedEventArgs e)
13801379
return;
13811380

13821381
var line = Math.Max(1, Math.Min(total, (int)Math.Ceiling(pressedY * total / height)));
1383-
if (this.Parent is Control parent)
1382+
if (Parent is Control parent)
13841383
parent.FindLogicalDescendantOfType<ThemedTextDiffPresenter>()?.ScrollToLine(line);
13851384

13861385
e.Handled = true;

0 commit comments

Comments
 (0)