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

Add a way to fetch multiple keystrokes for a single command #2493

Closed
mlewand opened this issue Oct 18, 2018 · 1 comment
Closed

Add a way to fetch multiple keystrokes for a single command #2493

mlewand opened this issue Oct 18, 2018 · 1 comment
Assignees
Labels
changelog:api A changelog entry should be put in the API section of the changelog. good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. target:major Any docs related issue that should be merged into a major branch. type:feature A feature request.
Milestone

Comments

@mlewand
Copy link
Contributor

mlewand commented Oct 18, 2018

Type of report

Feature request

Provide description of the new feature

Some commands might have multiple hotkeys, we need to API that returns all the hotkeys.

There's already a editor.getCommandKeystroke but it supports only one returned keystroke.

An example case is link command. In 4.11.0 we added ctrl+k keystroke in addition to already existing ctrl+l.

What are the options?

  • Introduce asArray (or returnMultiple or something like that) parameter that tells that the function should return an array. (We can't change currently returned value for backward compatibility)
  • Introduce complimentary editor.getCommandKeystrokes (note plural form).

Looking at above I'm more keen towards additional argument. Adding an extra function will further bloat our docs.

@mlewand mlewand added type:feature A feature request. good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. target:major Any docs related issue that should be merged into a major branch. changelog:api A changelog entry should be put in the API section of the changelog. labels Oct 18, 2018
@mlewand mlewand added this to the Backlog milestone Oct 18, 2018
@Comandeer
Copy link
Member

Comandeer commented Oct 18, 2018

I'd also go with parameter, returnMultiple. Having two functions with nearly identical names and different outputs could be very confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:api A changelog entry should be put in the API section of the changelog. good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. target:major Any docs related issue that should be merged into a major branch. type:feature A feature request.
Projects
None yet
Development

No branches or pull requests

3 participants