From 98575ed36f53f3fcc6b7dcfda7ac1a66eb36378c Mon Sep 17 00:00:00 2001 From: Thomas Schafer Date: Tue, 29 Apr 2025 09:57:56 +0100 Subject: [PATCH] Fix issue when cursor is at end of doc --- helix-core/src/surround.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }