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 UNIX-like Ctrl+U, Ctrl+K, Ctrl+A and Ctrl+E shortcuts #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

tomlandia
Copy link

No description provided.

@amasad
Copy link
Contributor

amasad commented Dec 26, 2014

Can't this be done using our jqconsole.RegisterShortcut API?

@tomlandia
Copy link
Author

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) ->
Copy link
Contributor

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)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amasad
Copy link
Contributor

amasad commented Dec 30, 2014

I'm convinced :) Just a small comment then I'll pull it

@tomlandia
Copy link
Author

Uh do you want to switch to object parameter in this pull request or after pulling?

@amasad
Copy link
Contributor

amasad commented Jan 2, 2015

it'd be great if we did it in this PR

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