Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

@jacekkopecky
Copy link

When dealing with key binding matching events, it is useful to be able to ignore failed bindings for modifiers, e.g. in atom/vim-mode#781.
This PR adds isAtomModifier to the exports of KeymapManager.

@nathansobo
Copy link
Contributor

I'm reluctant to expand the API here. How much of a hardship would it be to just test the keystroke yourself with a regex?

@jacekkopecky
Copy link
Author

It will be no hardship at all if you promise never to change the regex. 😀
Would it be possible to export just the regex somehow?

@nathansobo
Copy link
Contributor

I really don't foresee the format of the binding sequences changing, and that should be the only thing that matters.

@jacekkopecky
Copy link
Author

It's really this line that could foreseeably be expanded:

AtomModifiers.add(modifier) for modifier in ['ctrl', 'alt', 'shift', 'cmd']

But I can take your word for it on this one; and send the maintainer @maxbrunsfeld this way if he complains about a PR copying private code from one package into another. 😎

@nathansobo
Copy link
Contributor

Yeah, I get that it's annoying to not always have an API for stuff. I just feel like APIs get gross as we add all these random things. In this case a bit of duplication for a pretty special case is okay with me. The set of modifiers should be stable. Famous last words.

@jacekkopecky
Copy link
Author

Fair enough, I'll close this now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants