Skip to content
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

E539: Illegal character <,> #86

Open
naquad opened this issue Feb 28, 2023 · 1 comment
Open

E539: Illegal character <,> #86

naquad opened this issue Feb 28, 2023 · 1 comment

Comments

@naquad
Copy link

naquad commented Feb 28, 2023

I'm using lualine with lsp-status and I get the following error when I'm trying phpactor:

Error executing vim.schedule lua callback: ...acker/start/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: E539: Illegal character <,>                                                                                                                                                        
stack traceback:
        [C]: in function 'nvim_win_set_option'
        ...acker/start/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: in function 'setter_fn'
        ...acker/start/lualine.nvim/lua/lualine/utils/nvim_opts.lua:50: in function 'set_opt'
        ...acker/start/lualine.nvim/lua/lualine/utils/nvim_opts.lua:74: in function 'set'
        ...nvim/site/pack/packer/start/lualine.nvim/lua/lualine.lua:432: in function 'refresh'
        ...nvim/site/pack/packer/start/lualine.nvim/lua/lualine.lua:353: in function <...nvim/site/pack/packer/start/lualine.nvim/lua/lualine.lua:352>

Sometimes I see that error using other language servers. I've already seen a similar neoclide/coc.nvim#3051 but there it was related to the VIM script encoding.

@naquad
Copy link
Author

naquad commented Apr 26, 2023

Update

It was happening only for PHPActor LS, after some digging it figured out that the generated message looked like this:

[phpactor]   Indexing workspace 4500/6874 (65.46%, 243/5096 mb) (65%%)

Mind the single %.

A somewhat simplistic fix:

local function lsp_status_check()
  if #vim.lsp.buf_get_clients() == 0 then
    return ''
  end

  local status = lsp_status.status()
  status = status:gsub('%%%%', '%%') -- decode the encoded % sign
  status = status:gsub('%%', '%%%%') -- and encode them all
  return status
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant