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:
@@ -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"))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user