From aba8ffad1f15398cc991ff8501e47d002b1ae261 Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 22:34:07 +0000 Subject: [PATCH] text: Temporarily remove `assert_char_boundary` panics (#42919) (cherry-pick to stable) (#42926) Cherry-pick of #42919 to stable ---- As discussed in the first responders meeting. We have collected a lot of backtraces from these, but it's not quite clear yet what causes this. Removing these should ideally make things a bit more stable even if we may run into panics later one when the faulty anchor is used still. Release Notes: - N/A *or* Added/Fixed/Improved ... Co-authored-by: Lukas Wirth --- crates/multi_buffer/src/multi_buffer.rs | 11 ----------- crates/text/src/text.rs | 1 - 2 files changed, 12 deletions(-) diff --git a/crates/multi_buffer/src/multi_buffer.rs b/crates/multi_buffer/src/multi_buffer.rs index 5be61d1efe153fcd6902b33e46f2f5b84d4055e6..43def73ae257e29f007ef56fb181e03432023edb 100644 --- a/crates/multi_buffer/src/multi_buffer.rs +++ b/crates/multi_buffer/src/multi_buffer.rs @@ -3828,21 +3828,10 @@ impl MultiBufferSnapshot { { let main_buffer_position = cursor.main_buffer_position()?; let buffer_snapshot = &cursor.excerpt()?.buffer; - // remove this assert once we figure out the cause of the panics for #40453 - buffer_snapshot - .text - .as_rope() - .assert_char_boundary(main_buffer_position); return Some((buffer_snapshot, main_buffer_position)); } else if buffer_offset > region.buffer.len() { return None; } - // remove this assert once we figure out the cause of the panics for #40453 - region - .buffer - .text - .as_rope() - .assert_char_boundary(buffer_offset); Some((region.buffer, buffer_offset)) } diff --git a/crates/text/src/text.rs b/crates/text/src/text.rs index 851d4fecc402c06fcb4d5ed030796822a2c50558..3e5bffca50e64bb71b596c49a37b8e041ab2f9e5 100644 --- a/crates/text/src/text.rs +++ b/crates/text/src/text.rs @@ -2439,7 +2439,6 @@ impl BufferSnapshot { if offset > self.visible_text.len() { panic!("offset {} is out of bounds", offset) } - self.visible_text.assert_char_boundary(offset); let (start, _, item) = self.fragments.find::(&None, &offset, bias); let fragment = item.unwrap(); let overshoot = offset - start;