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:
parent
f63d8e4c53
commit
1dd237139c
6 changed files with 49 additions and 59 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue