New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop: Put all keybindings in default #3545
Conversation
Doesn't it mean that both regular and macOS shortcuts will be defined at the same time? i.e. Cmd+A and Ctrl+A do the same thing? If so I don't think that's the right approach as we should aim to be very specific about what shortcuts we support, so it should be Cmd+A only on macOS and Ctrl+A only on all other platforms. Isn't it possible to get it working by using addKeyMap in combination with the keyMap option? Perhaps you could even set the keyMap option to an empty array, then define explicitely all the kemaps we support via addKeyMap. That way it would be easier to have a conditional for macOS/Windows/Linux. It's true that the CodeMirror doc is not the clearest for this though. |
What I did here is that I manually set the default based on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than a typo it works, however I see that it's building the keymap every time I press a key. Shouldn't it be done within an effect?
Good suggestion! My thought was that since it's stable it didn't need to be in an effect. This was of course wrong, it's fixed now. |
Ok, there was still a typo keymap/keyMap which was crashing the app on macOS, but once fixed it's working fine. Thanks for the update! |
This is an attempt to fix #3499 , i think the issue is that
keymap.macosDefault
is just a reference and the actually used map is default.