Skip to content

Commit

Permalink
fix: Select matching at the start of the doc could crash. Fixes #346
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Jun 23, 2021
1 parent 7511110 commit 9c53461
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helix-core/src/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
}

Expand Down

0 comments on commit 9c53461

Please sign in to comment.