fix: scan_prev_match should find the match at the cursor if it is not selected
This commit is contained in:
parent
834b61b16f
commit
7b9a4071c8
1 changed files with 3 additions and 2 deletions
|
|
@ -5388,8 +5388,9 @@ pub const Editor = struct {
|
||||||
const count = self.matches.items.len;
|
const count = self.matches.items.len;
|
||||||
for (0..count) |i| {
|
for (0..count) |i| {
|
||||||
const match = if (self.matches.items[count - 1 - i]) |*m| m else continue;
|
const match = if (self.matches.items[count - 1 - i]) |*m| m else continue;
|
||||||
if (!match.has_selection and (row > match.end.row or (row == match.end.row and col > match.end.col)))
|
if (match.has_selection) continue;
|
||||||
return match;
|
if (cursor.eql(match.end)) return match;
|
||||||
|
if (row > match.end.row or (row == match.end.row and col > match.end.col)) return match;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue