diff --git a/zed/src/editor/buffer/rope.rs b/zed/src/editor/buffer/rope.rs index 05b30e3896..1b5d8fb896 100644 --- a/zed/src/editor/buffer/rope.rs +++ b/zed/src/editor/buffer/rope.rs @@ -213,7 +213,12 @@ impl<'a> Cursor<'a> { } pub fn slice(&mut self, end_offset: usize) -> Rope { - debug_assert!(end_offset >= self.offset); + debug_assert!( + end_offset >= self.offset, + "cannot slice backwards from {} to {}", + self.offset, + end_offset + ); let mut slice = Rope::new(); if let Some(start_chunk) = self.chunks.item() {