diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 6039092be50ed0977fb3fe6618201f21033ae15c..d4f47330a4ccadf753e5721a569ecc7b855b8d1f 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -5271,7 +5271,8 @@ impl Editor { if end_point == start_point { let offset = text::ToOffset::to_offset(&range.start, &snapshot) .saturating_sub(1); - start_point = TP::to_point(&offset, &snapshot); + start_point = + snapshot.clip_point(TP::to_point(&offset, &snapshot), Bias::Left); }; (start_point..end_point, empty_str.clone())