mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-11-28 12:42:09 +03:00
fix: Select matching at the start of the doc could crash. Fixes #346
This commit is contained in:
parent
7511110d82
commit
9c53461429
@ -352,7 +352,7 @@ pub fn select_on_matches(
|
||||
|
||||
let start = text.byte_to_char(start_byte + mat.start());
|
||||
let end = text.byte_to_char(start_byte + mat.end());
|
||||
result.push(Range::new(start, end - 1));
|
||||
result.push(Range::new(start, end.saturating_sub(1)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user