diff options
Diffstat (limited to 'helix-core/src/selection.rs')
-rw-r--r-- | helix-core/src/selection.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs index 67a20934..7dafc97a 100644 --- a/helix-core/src/selection.rs +++ b/helix-core/src/selection.rs @@ -383,7 +383,7 @@ pub fn split_on_matches( // TODO: retain range direction let end = text.byte_to_char(start_byte + mat.start()); - result.push(Range::new(start, end - 1)); + result.push(Range::new(start, end.saturating_sub(1))); start = text.byte_to_char(start_byte + mat.end()); } |