editor: Fix crash caused by editor::SelectPrevious (#24660)

Closes #24345

Release Notes:

- Fixed a crash caused by calling `editor::SelectPrevious` twice in a
row.

Co-authored-by: conrad <conrad@zed.dev>
This commit is contained in:
smitandconrad authored and GitHub committed 2025-02-11 22:07:44 +05:30
1 parent 176aac360a
commit d25dfbcdc6
2 files changed
+16 -1

No files matched your search

+1 -1
View File
@@ -7121,7 +7121,7 @@ impl<'a> Iterator for ReversedMultiBufferChunks<'a> {
self.offset -= 1;
Some("\n")
} else {
let chunk = self.current_chunks.as_mut().unwrap().next().unwrap();
let chunk = self.current_chunks.as_mut().unwrap().next()?;
self.offset -= chunk.len();
Some(chunk)
}