-
Notifications
You must be signed in to change notification settings - Fork 33
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 quick keys #479
Add quick keys #479
Conversation
How does this work? You start quick select and then each candidate is prefixed with a key or more keys, hh, hk etc depending on the number of candidates? |
The quick keys overwrite the candidate chars. I experimented with prefixing but it doesn't work well with horizontal display because the display width changes and I also think this is less bumpy so hopefully nicer as well. |
I will not merge this yet, please give it a try, I will look at it tomorrow again, good night! |
I tried it. The overwriting does not work correctly. When running this from consult-buffer it adds keys like as, ad, ... I don't understand why it generates the unnecessary "a" prefix key. Regarding the implementation - why use a quick-fun closure instead of just an array of keys indexed by the candidate index - this would be more direct? |
To be more precise - when it adds the keys "as", only the letter "s" overwrites the candidate and the "a" is prefixed, which makes the candidates move by one letter. And the "a" is unnecessary after all. Besides that - I like it. Maybe there is a more appropriate default face to be used which is more aligned with avy, but probably this should be fixed in the theme in the end. |
Thanks, for trying. You get two keys when there are too few candidates to highlight with As you noticed there is something wrong with consult-buffer. I will look into that and the closure thing you mentioned. |
What about using |
The reasoning for the bindings is coming from the bindings |
Yes, that is okay - avy does it in the same way. But I think it should still overwrite for single keys and double keys. There are two bugs - consult-buffer should not require more than a single key, I mean I still have only ten candidates. And the second bug is that the overwriting does not work correctly. |
Yes, I did not test with consult, will look into that. |
Regarding the keys, your argument makes sense. However Generally I find the usage of the ascii control key legacy in Emacs confusing. I am currently using a modified key map where I rebind ijkl to navigation, this messes with the "default" muscle memory where |
The problem is that I use |
Uh, okay. I guess we have to fix |
The insertion functions return how many candidates they inserted because it depends on their behavior. But they don't know which ones are actual candidates. |
The function |
Before the grouping |
|
Instead of returning the pair, the proper fix as I see it: Alternatively, you may want to rewrite the I think we should refactor that first before merging this PR. |
There is the complication though that horizp also controls if annotations/extension is added. I am unsure about the best way to fix this. One could always return annotations and the horizontal style could just ignore them or one keeps the horizp/add-annotations flag. |
It is also used to decide about highlight extension. |
I need to do a some more refactorings on master before this gets merged. |
33d819d
to
1de86c3
Compare
a442217
to
aa06a58
Compare
13ec457
to
329214e
Compare
See #304. Ping @mohkale