Skip to content

Make extension key context case-insensitive#45961

Merged
MrSubidubi merged 2 commits intozed-industries:mainfrom
krisfur:main
Jan 2, 2026
Merged

Make extension key context case-insensitive#45961
MrSubidubi merged 2 commits intozed-industries:mainfrom
krisfur:main

Conversation

@krisfur
Copy link
Contributor

@krisfur krisfur commented Jan 2, 2026

Closes #45960

Release Notes:

  • Made the extension key context case-insensitive. This e.g. enables the markdown: Open Preview action to also handle files where the extension is capitalised as MD (case-sensitive file system).

@cla-bot
Copy link

cla-bot bot commented Jan 2, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @krisfur on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@krisfur
Copy link
Contributor Author

krisfur commented Jan 2, 2026

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 2, 2026
@cla-bot
Copy link

cla-bot bot commented Jan 2, 2026

The cla-bot has been summoned, and re-checked this pull request!

Copy link
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

Curious though, perhaps this is better solved for all languages if we just make this case-insensitive here

if let Some(extension) = singleton_buffer.read(cx).file().and_then(|file| {
Some(
file.full_path(cx)
.extension()?
.to_string_lossy()
.into_owned(),
)
}) {
key_context.set("extension", extension);
}

What do you think?

@krisfur
Copy link
Contributor Author

krisfur commented Jan 2, 2026

Great shout @MrSubidubi! Simple .to_lowercase() and done, worked locally for me. Pushed and ready - it replaces .into_owned() as to_lowercase() already returns a new string so no other mangling needed.

Copy link
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for the quick follow-up, looks good! Thank you and congratulations to your first contribution! 🎉

@MrSubidubi MrSubidubi changed the title Fixed default open preview keymap for capitalised markdown extension on Linux Make extension key context case-insensitive Jan 2, 2026
@MrSubidubi MrSubidubi enabled auto-merge (squash) January 2, 2026 11:44
@MrSubidubi MrSubidubi self-assigned this Jan 2, 2026
@MrSubidubi MrSubidubi merged commit 3140025 into zed-industries:main Jan 2, 2026
25 checks passed
rtfeldman pushed a commit that referenced this pull request Jan 5, 2026
Closes #45960 

Release Notes:

- Made the `extension` key context case-insensitive. This e.g. enables
the `markdown: Open Preview` action to also handle files where the
extension is capitalised as MD (case-sensitive file system).
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
Closes zed-industries#45960 

Release Notes:

- Made the `extension` key context case-insensitive. This e.g. enables
the `markdown: Open Preview` action to also handle files where the
extension is capitalised as MD (case-sensitive file system).
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
Closes zed-industries#45960 

Release Notes:

- Made the `extension` key context case-insensitive. This e.g. enables
the `markdown: Open Preview` action to also handle files where the
extension is capitalised as MD (case-sensitive file system).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Markdown: Open Preview shortcut not working on linux for files where the .md extension is capitalised as .MD.

2 participants