fix: bug in scan_next_match causing add_cursor_next_match to fail
This commit is contained in:
parent
9bebebc086
commit
d08c65818f
1 changed files with 0 additions and 2 deletions
|
|
@ -5451,14 +5451,12 @@ pub const Editor = struct {
|
|||
fn scan_next_match(self: *const Self, cursor: Cursor) ?*Match {
|
||||
const row = cursor.row;
|
||||
const col = cursor.col;
|
||||
const multi_cursor = self.cursels.items.len > 1;
|
||||
for (self.matches.items) |*match_| if (match_.*) |*match| {
|
||||
if (match.has_selection) continue;
|
||||
switch (tui.get_selection_style()) {
|
||||
.normal => if (cursor.within(match.to_selection())) return match,
|
||||
.inclusive => {},
|
||||
}
|
||||
if (multi_cursor) continue;
|
||||
if (row < match.begin.row or (row == match.begin.row and col < match.begin.col)) return match;
|
||||
};
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue