Skip to content

Capture outer scope variable in config function #513

Answered by wbthomason
Tastyep asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, this is a well-known limitation of string.dump in Lua, which cannot capture closure variables. If you need this kind of capture, you can use a global, or you can pass a string instead of a function to the config key (e.g. [[require(config.some-plugin)]], where ~/.config/nvim/lua/config/some-plugin.lua is a file that does whatever setup you want. Forthcoming changes in #402 will remove this limitation, as we will no longer need to use string.dump.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Tastyep
Comment options

Answer selected by Tastyep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants