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

Auto Completion only on triggerChar #553

Open
felixendres opened this issue Aug 29, 2024 · 6 comments
Open

Auto Completion only on triggerChar #553

felixendres opened this issue Aug 29, 2024 · 6 comments

Comments

@felixendres
Copy link

Hi.
Thanks for the plugin, it's awesome!

I would like to configure completion such that it is only triggered automatically when I type a trigger character (e.g. ".", ">" for C++). If I need completions at other times, I can use C-X C-O.

I think this cannot be done with the current configuration options. I can get the behavior I want by modifying (or adding another) check for triggerKind after this line.

If you are fine with it, I'd like to contribute this as a PR:

  • Create a new option "autoCompleteOnTriggerCharOnly" with a default of v:false
  • Create a check after the linked line to return without completion if the above option is true but the trigger kind is something other than 2.
  • Document the new option

Would you merge that? Is there anything else I need to consider?
Best regards.

@Shane-XB-Qian
Copy link
Contributor

Shane-XB-Qian commented Aug 29, 2024 via email

@Shane-XB-Qian
Copy link
Contributor

i meant you either refine that func (and related others code) to make it work fine with all kinds, or just disable auto-compl, then using omni-compl for all cases including trigger char cases.

@felixendres
Copy link
Author

felixendres commented Sep 12, 2024

Ok, thank you for the feedback. I hope the PR addresses your concerns. Both options can now be set to any combination of trigger types and can be easily extended to include new ones.

@Shane-XB-Qian
Copy link
Contributor

Shane-XB-Qian commented Sep 13, 2024 via email

@felixendres
Copy link
Author

Why do you mention trigger kind 3?
It doesn't exist in GetTriggerAttributes() on the master branch

What do you mean by "refine that"?

@Shane-XB-Qian
Copy link
Contributor

Shane-XB-Qian commented Sep 16, 2024 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

No branches or pull requests

2 participants