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

Implement more trigger-types #923

Merged
merged 5 commits into from
Jun 24, 2023
Merged

Implement more trigger-types #923

merged 5 commits into from
Jun 24, 2023

Conversation

L3MON4D3
Copy link
Owner

This implements a new option, trigMatcher, which determines how the trigger is matched to the current line.

I've veered from calling it trigType, since it sounds like it would only accepts a string, whereas I'd like to make it possible to completely customize the trigger-matching by passing a function.
So, currently, trigMatcher accepts either a function (then uses that), a string (any from "plain", "pattern", "vim", "ecma" for plain strings, lua-patterns, vim-regex and ecma-regex respectively (the last two are not yet implemented)). If trigMatcher is not set at all, we look if regTrig is set and use "pattern" if it is, and if that is not set as well, we fall back to "plain".
I think this will also deprecate regTrig since that name was misleading from the start (but a very soft deprecation, I don't think we will actually remove it)

I'm not completely convinced by the name trigMatcher, if somebody has a different idea, mention it :D

@L3MON4D3 L3MON4D3 mentioned this pull request Jun 14, 2023
@L3MON4D3 L3MON4D3 linked an issue Jun 14, 2023 that may be closed by this pull request
@aikow
Copy link

aikow commented Jun 15, 2023

maybe just use 'trigger' instead of trigMatcher. Or you could follow regex terminology and use something like trigEngine...

@L3MON4D3
Copy link
Owner Author

Oh I like trigEngine, ty👍👍

@L3MON4D3 L3MON4D3 force-pushed the trigger-types branch 6 times, most recently from 34dd25b to ed6c108 Compare June 18, 2023 21:31
@L3MON4D3
Copy link
Owner Author

Alright, this should be it.
Any comments, now's the time :D

Check `trigEngine` in `:h luasnip-snippets`, or in `DOC.md`.
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.

More trigger-types
2 participants