on master help sign in
fix: Select matching at the start of the doc could crash. Fixes #346
9c53461Blaž Hrastnik
helix-core/src/selection.rs+1−1
@@ -352,7 +352,7 @@ pub fn select_on_matches(
352
352
353 let start = text.byte_to_char(start_byte + mat.start());
353 let start = text.byte_to_char(start_byte + mat.start());
354 let end = text.byte_to_char(start_byte + mat.end());
354 let end = text.byte_to_char(start_byte + mat.end());
355− result.push(Range::new(start, end - 1));
355+ result.push(Range::new(start, end.saturating_sub(1)));
356 }
356 }
357 }
357 }
358
358