fix: stop mac completion bindings from stealing backticks#8829
Merged
mscolnick merged 2 commits intomarimo-team:mainfrom Mar 23, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a macOS-specific CodeMirror completion keybinding conflict where `Alt/Option + `` can trigger completion instead of inserting a backtick (notably on international layouts).
Changes:
- Updates completion keybinding filtering to consider platform-specific binding fields (
key,mac,linux,win) rather than onlybinding.key. - Reworks the completion keymap unit tests to attempt to validate that `Alt-`` isn’t intercepted.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| frontend/src/core/codemirror/completion/keymap.ts | Filters out problematic completion keybindings across platform-specific key fields. |
| frontend/src/core/codemirror/completion/tests/keymap.test.ts | Adds/updates tests intended to cover the macOS `Alt-`` binding behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
frontend/src/core/codemirror/completion/__tests__/keymap.test.ts
Outdated
Show resolved
Hide resolved
frontend/src/core/codemirror/completion/__tests__/keymap.test.ts
Outdated
Show resolved
Hide resolved
mscolnick
approved these changes
Mar 23, 2026
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.21.2-dev34 |
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.
Summary
Fixes a macOS notebook editor bug where typing a backtick can trigger CodeMirror completion instead of inserting the character.
This affects international layouts that produce backtick through
Alt/Option, including HungarianOption+ű.Details
The intended fix was already in place conceptually: marimo tries to remove the problematic
Alt-`completion shortcut.It seems like the bug was that the filter only checked
binding.key, while upstream CodeMirror currently exposes this shortcut as a mac-specific binding:So the shortcut was never actually removed.
This PR changes the filter to check all platform-specific keybinding fields:
keymaclinuxwinTests
The follow-up test after GH Copilot review now checks the filtered bindings returned by
completionKeymap()directly. Chose that over ajsdomevent test because CodeMirror snapshots platform at module load, so a mac-only shortcut test there would be brittle and could pass for the wrong reason on non-mac CI.