mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
Add custom error message for rope cursor slice precondition
This commit is contained in:
parent
e021154852
commit
68994248ee
1 changed files with 6 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue