diff --git a/helix-core/src/surround.rs b/helix-core/src/surround.rs index bcbcce38b..414ccbbff 100644 --- a/helix-core/src/surround.rs +++ b/helix-core/src/surround.rs @@ -173,7 +173,7 @@ pub fn find_nth_pairs_pos( if text.len_chars() < 2 { return Err(Error::PairNotFound); } - if range.to() >= text.len_chars() { + if range.to() > text.len_chars() { return Err(Error::RangeExceedsText); }