Fix panic when a file in a path-based multibuffer excerpt is renamed (#28364)

Closes #ISSUE

Release Notes:

- Fixed a panic that could occur when paths changed in the project diff.

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Cole Miller 2025-04-08 18:01:40 -04:00 committed by GitHub
parent 246013cfc2
commit 0459b1d303
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 105 additions and 20 deletions

View file

@ -2231,6 +2231,7 @@ impl BufferSnapshot {
} else if *anchor == Anchor::MAX {
self.visible_text.len()
} else {
debug_assert!(anchor.buffer_id == Some(self.remote_id));
let anchor_key = InsertionFragmentKey {
timestamp: anchor.timestamp,
split_offset: anchor.offset,