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

Use Alt+Key for fast alias expansion in index view #72

Closed
wants to merge 1 commit into from

Conversation

seifferth
Copy link
Contributor

Cf. #31. This commit adds
Alt+Key keybindings to the index view. Pressing Alt+Key will treat
Key as a single letter search alias that is invoked directly without
prompting the user to enter more text. This provides a slightly more
convenient way to switch between frequent queries.

I also decided to keep aliases out of the search history if invoked
via Alt+Key. Having all those implicitly invoked standard searches
in the history would have felt a lot like cluttering it unnecessarily.

Cf. <wangp#31>. This commit adds
Alt+Key keybindings to the index view. Pressing Alt+Key will treat
Key as a single letter search alias that is invoked directly without
prompting the user to enter more text. This provides a slightly more
convenient way to switch between frequent queries.

I also decided to keep aliases out of the search history if invoked
via Alt+Key. Having all those implicitly invoked standard searches
in the history would have felt a lot like cluttering it unnecessarily.
@wangp
Copy link
Owner

wangp commented Sep 15, 2020

Interesting idea. I can't really see a problem with it except that we might want to introduce an Alt key binding one day (probably unlikely), which would potentially conflict with someone's configuration. Well, it would be an easy fix for the user.

Another option is simply a two key sequence, e.g. c x could invoke the search ~x.

@seifferth
Copy link
Contributor Author

Another option is simply a two key sequence, e.g. c x could invoke the search ~x.

True, but then we do already have a three key sequence that does already this: ~<Key><Enter>.

I can't really see a problem with it except that we might want to introduce an Alt key binding one day (probably unlikely)

True again. But as we don't use Alt yet, I figured that this should be fine for now. As you said, we could still reserve some Alt+Key combinations later on. I don't really think that the need would ever arise, though. Even if we reserve Alt for search term expansion, we are still left with way more unused keys than we should ever need. Also note that this only affects the index view, so Alt is still free for use in all the others.

@wangp
Copy link
Owner

wangp commented Sep 19, 2020

Merged. Let's try it out.

@wangp wangp closed this Sep 19, 2020
@seifferth
Copy link
Contributor Author

seifferth commented Sep 19, 2020 via email

@wangp
Copy link
Owner

wangp commented Sep 20, 2020

You're right. It was only my intention to filter out control characters, Alt+Backspace, Alt+Enter and so on. I've relaxed it to allow any "printable" character as defined by isprint, which is the same test we use for the text entry module so it should be okay.

@seifferth
Copy link
Contributor Author

seifferth commented Sep 20, 2020 via email

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.

None yet

2 participants