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

Lua function snippet is recursive #1466

Open
idbrii opened this issue Oct 21, 2022 · 0 comments
Open

Lua function snippet is recursive #1466

idbrii opened this issue Oct 21, 2022 · 0 comments

Comments

@idbrii
Copy link
Contributor

idbrii commented Oct 21, 2022

snippet !fun(ction)?! "New function" br

  1. type fun
  2. trigger snippet
  3. delete name (because you're making an anonymous function)
  4. trigger UltiSnipsJumpForwardTrigger (to jump to args)
  5. snippet expands again because it matches "function"

Workaround:

clearsnippets !fun(ction)?!
snippet fun "New function" b
function ${1:new_function}(${2:args})
	$0
end
endsnippet

(Should work, but I only use the clearsnippets part. I have a significantly more involved snippet that tries to be smart and get a relevant table/class.)

Fixing this requires changing the snippet expand trigger. Maybe adding my smarter version makes that a worthwhile tradeoff?

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

1 participant