svg_preview: Detect SVG in single-file mode by checking file name#45747
Merged
MrSubidubi merged 2 commits intozed-industries:mainfrom Dec 27, 2025
Merged
Conversation
Use the files full path and file name as fallbacks when the worktree-relative path is empty, so SVG previews and the toolbar button work in single-file mode.
MrSubidubi
requested changes
Dec 27, 2025
Member
MrSubidubi
left a comment
There was a problem hiding this comment.
Thanks for looking into this! I think we can simplify this, left a comment below.
Also, not required, but could I interest you into looking to add a test case for this? You might need to copy quite some code for this from elsewhere (and even need to add the test elsewhere). Yet, with a test, we'd be more certain this does not regress any time soon (and I think changes here need to be done at some point, so would be nice to have, but as mentioned, not required). Thanks!
MrSubidubi
approved these changes
Dec 27, 2025
Member
MrSubidubi
left a comment
There was a problem hiding this comment.
Nice! Thank you both for the fix as well as the fast follow up! Appreciated
CherryWorm
pushed a commit
to CherryWorm/zed
that referenced
this pull request
Dec 30, 2025
…d-industries#45747) Release Notes: - Use the files name for "is svg" checks so SVG previews and the toolbar button work in single-file mode.
rtfeldman
pushed a commit
that referenced
this pull request
Jan 5, 2026
…5747) Release Notes: - Use the files name for "is svg" checks so SVG previews and the toolbar button work in single-file mode.
LivioGama
pushed a commit
to LivioGama/zed
that referenced
this pull request
Jan 20, 2026
…d-industries#45747) Release Notes: - Use the files name for "is svg" checks so SVG previews and the toolbar button work in single-file mode.
LivioGama
pushed a commit
to LivioGama/zed
that referenced
this pull request
Jan 20, 2026
…d-industries#45747) Release Notes: - Use the files name for "is svg" checks so SVG previews and the toolbar button work in single-file mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release Notes: