Fix subtraction with overflow (#33471)

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-06-26 12:38:54 -06:00 committed by GitHub
parent 4983b01c89
commit b079871428
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -220,7 +220,9 @@ impl Vim {
}
ranges.push(start..end);
if end.column == snapshot.line_len(MultiBufferRow(end.row)) {
if end.column == snapshot.line_len(MultiBufferRow(end.row))
&& end.column > 0
{
end = snapshot.clip_point(end - Point::new(0, 1), Bias::Left);
}
cursor_positions.push(end..end)