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

[how-to] Set minimal prefix length depends on language #146

Closed
qingshuizheng opened this issue Mar 24, 2022 · 1 comment
Closed

[how-to] Set minimal prefix length depends on language #146

qingshuizheng opened this issue Mar 24, 2022 · 1 comment

Comments

@qingshuizheng
Copy link

Hi Minad,

Is there a way to set corfu-auto-prefix length based on the language.
My use case is that: when I type english, I like it to be length of 3; when I type Chinese, I like it to be 2.

I have tried this, but to no void:
(setq corfu-auto-prefix (if (looking-back "[[:alpha:]]") 3 2))

Thank you.

@minad
Copy link
Owner

minad commented Mar 24, 2022

I think that your setter should work if you change the value of corfu-auto-prefix locally in a :before advice of corfu--auto-complete. Maybe use A-Za-z instead of :alpha:? Did you try this? If you have separate buffers you can also change the prefix length buffer locally. But such a behavior is very special we cannot support it ootb.

@minad minad closed this as completed Mar 24, 2022
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