-
Notifications
You must be signed in to change notification settings - Fork 40
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
utility function get_highlight
breaks the plugin
#22
Comments
Can you please report the error? Edit: got it. I'll fix soon. For the moment, don't access the style when using this utility function. |
The last commits now cause a stack overflow, which comes from recursive calls to setmetatable(hl, {
__index = function(t, k)
if k == "fg" then
return t.foreground -- Leads to stack overflow.
elseif k == "bg" then
return t.background -- This too.
elseif k == "sp" then
return t.special -- This too.
else
return t[k] -- And also this...
end
end,
}) This is easily fixed by using the builtin setmetatable(hl, {
__index = function(t, k)
if k == "fg" then
return rawget(t, 'foreground')
elseif k == "bg" then
return rawget(t, 'background')
elseif k == "sp" then
return rawget(t, 'special')
else
return rawget(t, k)
end
end,
}) By using the code above, I could fix the stack overflow bug, but by using the same configurations I used before |
can you provide an example hl that gets you the error? after fix with rawget |
I see you are using fennel. I cannot test with that and I cannot reproduce in lua. hl table now needs to comply with nvim_set_hl. So style field is deprecated and style elements should be passed as Booleans, like please see #17 (comment) Can you please test with a minimal config and report where it breaks? |
nvim_set_hl
breaks the pluginget_highlight
breaks the plugin
I realized that I was setting fields that doesn't work anymore as, for exemple, |
Great! Btw, |
After commit
0b93d18
, the plugin attempts to pass a table with thenone
key tonvim_set_hl
function, which breaks the status line. I skimmed the code and I found the following piece in functionget_highlight
in moduleheirline.utils
.Maybe the way that highlights were handled by this plugin is still not compliant to the
nvim_set_hl
function.The text was updated successfully, but these errors were encountered: