We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
BlockNavigation.UpdateByCaretPosition
1 parent c72a151 commit 19ce2d0Copy full SHA for 19ce2d0
src/ViewModels/BlockNavigation.cs
@@ -130,23 +130,23 @@ public void UpdateByCaretPosition(int caretLine)
130
return;
131
}
132
133
+ _current = -1;
134
+
135
for (var i = 0; i < _blocks.Count; i++)
136
{
137
var block = _blocks[i];
- if (block.End < caretLine)
- continue;
138
-
139
if (block.Start > caretLine)
140
- _current = i - 1;
141
- else
142
- _current = i;
+ break;
143
144
- OnPropertyChanged(nameof(Indicator));
145
- break;
+ _current = i;
+ if (block.End >= caretLine)
146
+ OnPropertyChanged(nameof(Indicator));
147
148
149
private int _current;
150
- private List<Block> _blocks = [];
+ private readonly List<Block> _blocks = [];
151
152
0 commit comments