-
Notifications
You must be signed in to change notification settings - Fork 47
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
:Lushify
error: Could not parse buffer due to Lua error
#100
Comments
Returning the spec will fix the error I have added a Right now this is only in the
|
That makes a lot of sense, had no idea how lush worked. I've checked the I wouldn't mind if you close the issue now, thanks! |
Probably this is happening because Lua has cached your module. Assuming you have -- colors.lua
return {
red = ...
green = ...
} and -- theme.lua
local M = {}
M.get_theme = function()
local lush = require 'lush'
local colors = require 'colors'
local theme = lush(function()
return {
Normal { bg = colors.green }, -- Normal text
}
end)
return theme
end
return M You need to clear lua's module cache for -- theme.lua
local M = {}
M.get_theme = function()
local lush = require 'lush'
-- remove any cached colors module
package.loaded["colors"] = nil -- or "my.theme.colors", etc
-- this require will now always hit the disk
local colors = require 'colors'
... See also the first paragraph here: http://www.lua.org/manual/5.1/manual.html#pdf-require |
Do you mind putting your theme online for me to take a look at? It would be nice if this workflow worked if possible. |
Here, it's a bit more complex now, hopefully that's alright, highlights still behave the same way as in my previous comment. |
Minimal example of what I'm working with:
./lua/my_theme/init.lua
:./colors/my_theme.lua
:Opening
./lua/my_theme/init.lua
file and runing:Lushify
, throws this error:Lush.ify: Could not parse buffer due to Lua error: ...vim/site/pack/packer/opt/lush.nvim/lua/lush/compiler.lua:91: attempt to index local 'def' (a function value)
The text was updated successfully, but these errors were encountered: