diff --git a/crates/rope/src/chunk.rs b/crates/rope/src/chunk.rs index 69553eafb1b852960fa794d1b00ab28eba14888a..49bc88462171c271e8adbdeb7d0976e51e2514c7 100644 --- a/crates/rope/src/chunk.rs +++ b/crates/rope/src/chunk.rs @@ -721,7 +721,7 @@ fn panic_char_boundary(text: &str, offset: usize) -> ! { #[inline(never)] #[track_caller] fn log_err_char_boundary(text: &str, offset: usize) { - if offset > text.len() { + if offset >= text.len() { log::error!( "byte index {} is out of bounds of `{:?}` (length: {})", offset,