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

Corfu and evil repeat #168

Closed
aaronjensen opened this issue May 14, 2022 · 8 comments
Closed

Corfu and evil repeat #168

aaronjensen opened this issue May 14, 2022 · 8 comments

Comments

@aaronjensen
Copy link

Hi, I don't know if you use evil or not or if you'd prefer I close this and open the issue on Evil, but I've noticed that evil-repeat (the . key) does not work with corfu auto completion (I use a tab'n'go style).

Specifically, if I do something like this:

foo
foo
foo

Point on first foo, cw, ba tab to select bar, go down to foo and hit ., only ba will be included.

In company, this was first reported here: company-mode/company-mode#15
And addressed with: https://github.com/emacs-evil/evil/blob/master/evil-integration.el#L212-L230

I can't make it work with corfu with any combination of evil repeat specifications.

cc @tomdl89 in case has any ideas or would like me to move this to evil's repo.

Thanks all.

CleanShot 2022-05-14 at 00 08 11

@minad
Copy link
Owner

minad commented May 14, 2022

I don't use evil, mainly because I am not fond of having two layered sets of keybindings and because of all these integration issues. But I am not religious about modal or non-modal bindings ;)

I opened emacs-evil/evil-collection#552 at some point. Hopefully the issue can be fixed there. I am not familiar with the inner workings of evil, therefore I suggest you move the issue to the evil or evil-collection tracker.

Unfortunately such integration issues are always a bit hard to resolve since you may need someone knowledgeable about both packages and Corfu is not used so widely. Probably you yourself are in the best position to figure this one out.

@minad minad closed this as completed May 14, 2022
@aaronjensen
Copy link
Author

Thank you, much appreciated.

@aaronjensen
Copy link
Author

@minad could you say a little bit about how corfu works? When I do corfu-next, how is the buffer updated with the next candidate?

@minad
Copy link
Owner

minad commented May 14, 2022

There is no update, it is just an overlay. The update happens in the very end.

@aaronjensen
Copy link
Author

Ah, what causes the update at the very end? In the case of tab and go is it a precmd on whatever I use to do something else?

@minad
Copy link
Owner

minad commented May 14, 2022

corfu-insert inserts the selected candidate.

@aaronjensen
Copy link
Author

For tab-n-go corfu-insert is never invoked, but corfu--insert is.

I think that this is the secret:

https://github.com/company-mode/company-mode/blob/master/company-tng.el#L123-L127

Company unreads the command that would exit company and changes the command to company-complete-selection. I can play with doing the same.

@minad
Copy link
Owner

minad commented May 14, 2022

Right, for tabngo insertion happens in the pre-command-hook.

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

No branches or pull requests

2 participants