svg_preview: Fix SVG preview opening duplicate tabs (#49250)

Release Notes:

- Fixed SVG preview always opening a new tab instead of reusing an
existing one for the same file.
This commit is contained in:
Smit Barmase 2026-02-16 13:46:28 +05:30 committed by GitHub
parent 2c59293b69
commit 9d59aa038e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -141,7 +141,7 @@ impl SvgPreviewView {
buffer: &Entity<MultiBuffer>,
cx: &App,
) -> Option<usize> {
let buffer_id = buffer.entity_id();
let buffer_id = buffer.read(cx).as_singleton()?.entity_id();
pane.items_of_type::<SvgPreviewView>()
.find(|view| {
view.read(cx)