Skip to content
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

Added name properties to pre defined keymaps #3383

Closed
wants to merge 2 commits into from

Conversation

mkarajohn
Copy link

cm.removeKeyMap(), as per documentation, depends on the name property of the active keymap in order to remove it if a string is passed as an argument. Most predefined keymaps did not have a name property, leading to unexpected behaviour.

cm.removeKeyMap(map: object)
Disable a keymap added with addKeyMap. Either pass in the key map object itself, or a string, which will be compared against the name property of the active key maps.

cm.removeKeyMap() function depends on the .name property of the active keymap in order to remove it if a string is passed as an argument
@marijnh
Copy link
Member

marijnh commented Jul 13, 2015

The keymaps in the distribution are meant to be used as base keymaps (the keyMap option). Using them with addKeyMap is probably not what you want.

@mkarajohn
Copy link
Author

Ok, I see.

So, what would be the best way to enable and disable (toggle) the sublime keymap, for example?

@marijnh
Copy link
Member

marijnh commented Jul 13, 2015

You probably want a select, not a checkbox, for choosing a base keymap. You can do editor.setOption("keymap", "default") to go back to the default map.

@marijnh marijnh closed this Jul 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants