nvim-metals
nvim-metals copied to clipboard
`g:metals_status` breaks statusline because of unescaped characters
Describe the bug
g:metals_status
sometimes contains unescaped %
symbols that breaks the status line evaluation (vim.api.nvim_eval_statusline) because those are special characters.
Expected behavior
%
and any other posible special characters according to the statusline definition should be escaped
Operating system
macOS
Version of Metals
v0.11.8
Commit of nvim-metals
1284bbf8d79fe010909e65abdd849f047ff51914
Hey @caenrique thanks for the report! I never noticed or thought of this before. Do you have any examples of when this was the case for you? An example of the message specifically?
I guess we could scan the string on the nvim-metals side and replace any occurrence of %
with %%
and that should do the trick.
Yes! one example is: Compiling subscriptions 5s (0%)
.
I'm using feline.nvim for the statusline and I also created an issue there before I found the exact problem.
Replacing %
with %%
is exactly what I'm doing now to fix it, as suggested in the issue:
string.gsub(vim.g['metals_status'], '[%%]', '%%%1')