Fix more improper uses of the buffer_id field of Anchor (#36636)

Follow-up to #36524 

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-08-21 09:24:34 -04:00 committed by GitHub
parent f63d8e4c53
commit 1dd237139c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 49 additions and 59 deletions

View file

@ -4393,12 +4393,13 @@ impl OutlinePanel {
})
.filter(|(match_range, _)| {
let editor = active_editor.read(cx);
if let Some(buffer_id) = match_range.start.buffer_id
let snapshot = editor.buffer().read(cx).snapshot(cx);
if let Some(buffer_id) = snapshot.buffer_id_for_anchor(match_range.start)
&& editor.is_buffer_folded(buffer_id, cx)
{
return false;
}
if let Some(buffer_id) = match_range.start.buffer_id
if let Some(buffer_id) = snapshot.buffer_id_for_anchor(match_range.end)
&& editor.is_buffer_folded(buffer_id, cx)
{
return false;