Skip to content

Commit

Permalink
Do not show image viewer for SVGs (#10435)
Browse files Browse the repository at this point in the history
Absent some ability to toggle between viewing and editing a file, I
think it would be best to get a fix out quick for people to edit SVGs as
text files.

Release Notes:

- Fixed editing of SVG images by disabling it from the image viewer
([#10403](#10403)).
  • Loading branch information
rgbkrk committed Apr 11, 2024
1 parent b01c07b commit 92d5f2c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/image_viewer/src/image_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ impl project::Item for ImageItem {
.and_then(OsStr::to_str)
.unwrap_or_default();

if Img::extensions().contains(&ext) {
// Only open the item if it's a binary image (no SVGs, etc.)
// Since we do not have a way to toggle to an editor
if Img::extensions().contains(&ext) && !ext.contains("svg") {
Some(cx.spawn(|mut cx| async move {
let abs_path = project
.read_with(&cx, |project, cx| project.absolute_path(&path, cx))?
Expand Down

0 comments on commit 92d5f2c

Please sign in to comment.