fix: scan_next_match in .inclusive selection mode

This commit is contained in:
CJ van den Berg 2025-11-11 14:22:42 +01:00
parent e6f0953732
commit 3ff32507f7
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -5394,7 +5394,10 @@ pub const Editor = struct {
const multi_cursor = self.cursels.items.len > 1; const multi_cursor = self.cursels.items.len > 1;
for (self.matches.items) |*match_| if (match_.*) |*match| { for (self.matches.items) |*match_| if (match_.*) |*match| {
if (match.has_selection) continue; if (match.has_selection) continue;
if (cursor.within(match.to_selection())) return match; switch (tui.get_selection_style()) {
.normal => if (cursor.within(match.to_selection())) return match,
.inclusive => {},
}
if (multi_cursor) continue; if (multi_cursor) continue;
if (row < match.begin.row or (row == match.begin.row and col < match.begin.col)) return match; if (row < match.begin.row or (row == match.begin.row and col < match.begin.col)) return match;
}; };