svg_preview: Detect SVG in single-file mode by checking file name (#45747)

Release Notes:

- Use the files name for "is svg" checks so SVG previews and the toolbar
button work in single-file mode.
This commit is contained in:
Gabe Shahbazian authored and GitHub committed 2025-12-27 23:29:36 +00:00
1 parent 53fae55faf
commit cfd41edebc
1 file changed
+1 -1
+1 -1
View File
@@ -196,7 +196,7 @@ impl SvgPreviewView {
.as_singleton()
.and_then(|buffer| buffer.read(cx).file())
.is_some_and(|file| {
file.path()
std::path::Path::new(file.file_name(cx))
.extension()
.is_some_and(|ext| ext.eq_ignore_ascii_case("svg"))
})