feline.nvim
feline.nvim copied to clipboard
E542: Unbalanced groups
I have this error from time to time, and I can't figure out why
E5108: Error executing lua ...e/pack/packer/start/feline.nvim/lua/feline/generator.lua:517: E542: unbalanced groups
stack traceback:
[C]: in function 'nvim_eval_statusline'
...e/pack/packer/start/feline.nvim/lua/feline/generator.lua:517: in function 'get_component_width'
...e/pack/packer/start/feline.nvim/lua/feline/generator.lua:609: in function <...e/pack/packer/start/feline.nvim/lua/feline/generator.lua:526>
Do you have any idea about the source of the problem?? my configs can be found here
Originally posted by @caenrique in https://github.com/feline-nvim/feline.nvim/discussions/292
The link to your config is broken
Sorry, I updated the link to a public repository 😅 here is the link as well
can you comment out components one by one until you find out which component is causing this
I think it's related with this component (coming from nvim-metals) which is text coming from a global variable and is has variable lenght. My guess is that when this texts doesn't fit, it crashes.
I managed to isolate a generated statusline string that make vim.api.nvim_eval_statusline
fail:
"%#StatusComponent_CDD6F4_313244_NONE#Compiling subscriptions 5s (0%)%#StatusComponent_NONE_313244_NONE# "
posibly because of the %
sign?
I'm guessing that the provider string has unescaped %
characters which can mess things up. You should probably escape those %
s manually in that case
I was seeing the same errors (also from nvim-metals statuses) and was able to escape the '%' escape character successfully (from lua) with s:gsub("[%%]", "%%%1")
- you might need to escape #
in that line as well, like s:gsub("[%%%#]", "%%%1")
.
Closing this as it is not a Feline issue.