-
Notifications
You must be signed in to change notification settings - Fork 109
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 UNIX-like Ctrl+U, Ctrl+K, Ctrl+A and Ctrl+E shortcuts #69
base: master
Are you sure you want to change the base?
Conversation
Can't this be done using our |
Ah maybe, adding an arg to ClearPromptText. But why wouldn't these shortcuts be built-in just like Ctrl-Left and Ctrl-Right, and like in GNU Readline? I use several sites using jqconsole and wouldn't like to patch each one... |
@@ -1021,10 +1027,13 @@ class JQConsole | |||
|
|||
# Deletes the character or word following the cursor. | |||
# @arg whole_word: Whether to delete a whole word rather than a character. | |||
_Delete: (whole_word) -> | |||
# @arg whole_line: Whether to delete the whole line after cursor (Ctrl-K) | |||
_Delete: (whole_word, whole_line) -> |
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.
can we make this into options instead. You can use destructering to have a nice syntax in the method definition:
_Delete: ({whole_word, whole_line}) ->
And in the callsite:
_Delete(whole_word: true)
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.
here is an interesting read about this http://ariya.ofilabs.com/2011/08/hall-of-api-shame-boolean-trap.html
I'm convinced :) Just a small comment then I'll pull it |
Uh do you want to switch to object parameter in this pull request or after pulling? |
it'd be great if we did it in this PR |
No description provided.