-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 ability to register commands using simple strings (fixes #2806) #2807
Conversation
This looks good to me, I like the simplicity to the user I think a note in the readme as an example would be nice |
] | ||
} | ||
] | ||
"vim.normalModeKeyBindingsNonRecursive": [ |
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.
Awesome! Would you mind updating the other examples to use the more simplified version?
I'd also be sure to leave examples of how to specify multiple commands and such with both notations.
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.
Do you have an example of a command which also take arguments? I tried finding one to show a "complete" object but didn't succeed.
In may case I'll change the README in a way that suggests the string is the default, and then when the command takes additional arguments you can use the fully fledged object.
Alright, I changed all the examples in the README to use that syntax, and also added a command that uses arguments to show the difference ( |
Thanks! |
What this PR does / why we need it:
Enables the syntax specified in #2806 to work.
Which issue(s) this PR fixes
#2806.
Notes:
This simply makes the "command" object in
IKeyRemapping
be either the old object or a string. If it's a string, we then interpret the string as{ command: str; args: [] }
.