lualine.nvim icon indicating copy to clipboard operation
lualine.nvim copied to clipboard

E539: Illegal character <,>

Open rickalex21 opened this issue 1 year ago • 6 comments

Self Checks

  • [X ] I'm using the latest lualine.
  • [X ] I didn't find the issue in existing issues or PRs.

How to reproduce the problem

Using fzf.vim with ripgrep when this line of code is in the config causes the error. The commented out line does not cause the error:

" let spec = {'options': ['--phony', '--query', query, '--bind', 'change:reload:'.reload_command]}
	let spec = {'options': ['--preview-window','up,75%,border-bottom,+{2}+3/3,~3','--phony', '--query', query, '--bind', 'change:reload:'.reload_command]}
	call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), fullscreen)

Expected behaviour

No errors

Actual behaviour

It's giving an error about a comma. Not sure what lualine has to do with fzf? A lot of it mentions nvim_win_set_option and vim.schedule.

Error executing vim.schedule lua callback: ...vim/plugged/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: E539: Illegal character <,>             
stack traceback:                                                                                                                                   
        [C]: in function 'nvim_win_set_option'                                                                                                     
        ...vim/plugged/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: in function 'setter_fn'                                                    
        ...vim/plugged/lualine.nvim/lua/lualine/utils/nvim_opts.lua:50: in function 'set_opt'                                                      
        ...vim/plugged/lualine.nvim/lua/lualine/utils/nvim_opts.lua:74: in function 'set'                                                          
        ...itchie/.config/nvim/plugged/lualine.nvim/lua/lualine.lua:432: in function 'refresh'                                                     
        ...itchie/.config/nvim/plugged/lualine.nvim/lua/lualine.lua:353: in function <...itchie/.config/nvim/plugged/lualine.nvim/lua/lualine.lua:3
52>                           
Press ENTER or type command to continue                                                                                                            
Error executing vim.schedule lua callback: ...vim/plugged/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: E539: Illegal character <,>             
stack traceback:                                                                                                                                   
        [C]: in function 'nvim_win_set_option'                                                                                                     
        ...vim/plugged/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: in function 'setter_fn'                                                    
        ...vim/plugged/lualine.nvim/lua/lualine/utils/nvim_opts.lua:50: in function 'set_opt'                                                      
        ...vim/plugged/lualine.nvim/lua/lualine/utils/nvim_opts.lua:74: in function 'set'                                                          
        ...itchie/.config/nvim/plugged/lualine.nvim/lua/lualine.lua:432: in function 'refresh'                                                     
        ...itchie/.config/nvim/plugged/lualine.nvim/lua/lualine.lua:353: in function <...itchie/.config/nvim/plugged/lualine.nvim/lua/lualine.lua:3
52>    

rickalex21 avatar Feb 29 '24 20:02 rickalex21

I don't use fzf, but I have the bug as well, it started to pop up after configuring in bufferline.nvim to second lualine.

This is the usual pattern in logs after the lualine become absolutely useless ...

Error executing vim.schedule lua callback: ...e/nvim/lazy/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: E539: Illegal character < >
stack traceback:
        [C]: in function 'nvim_win_set_option'
        ...e/nvim/lazy/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: in function 'setter_fn'
        ...e/nvim/lazy/lualine.nvim/lua/lualine/utils/nvim_opts.lua:50: in function 'set_opt'
        ...e/nvim/lazy/lualine.nvim/lua/lualine/utils/nvim_opts.lua:74: in function 'set'
        ...e/su/.local/share/nvim/lazy/lualine.nvim/lua/lualine.lua:432: in function 'refresh'
        ...e/su/.local/share/nvim/lazy/lualine.nvim/lua/lualine.lua:353: in function <...e/su/.local/share/nvim/lazy/lualine.nvim/lua/lualine.lua:352>
Error executing vim.schedule lua callback: ...share/nvim/lazy/lualine.nvim/lua/lualine/utils/utils.lua:211: lualine: Failed to refresh statusline:
...e/nvim/lazy/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: E539: Illegal character < >
stack traceback:
        [C]: in function 'error'
        ...share/nvim/lazy/lualine.nvim/lua/lualine/utils/utils.lua:211: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

sudomyju avatar Mar 12 '24 08:03 sudomyju

is there some way to restart lualine and perhaps some easy way to debug it?

sudomyju avatar Mar 12 '24 08:03 sudomyju

I also managed to reproduce this with a custom component, but it's not consistent unfortunately. I'm unsure what exactly causes it.

Update: I've found out that this is caused by an invalid percent escape sequence such as %, being returned by a component. This means that I believe this to be a bug in the implementation of the respective component.

LordMZTE avatar Apr 26 '24 13:04 LordMZTE

still suffer from this, as a result I remove all lualine addon

gukz avatar Jun 27 '24 02:06 gukz

I also managed to reproduce this with a custom component, but it's not consistent unfortunately. I'm unsure what exactly causes it.

Update: I've found out that this is caused by an invalid percent escape sequence such as %, being returned by a component. This means that I believe this to be a bug in the implementation of the respective component.

Also suffer from this. In my case, it's pretty easy, nearly 100%, to reproduce for openning htm or js files.

liangkarl avatar Jul 03 '24 18:07 liangkarl

Once I remove lsp-status, it would be back to normal

@@ -34,7 +34,7 @@ return { -- Status line (button)
         lualine_a = { 'mode' },
         lualine_b = { 'branch', 'diff', 'diagnostics' },
         lualine_c = { 'filename' },
-        lualine_x = { 'searchcount', "require('lsp-status').status()", 'encoding', 'fileformat', 'filetype' },
+        lualine_x = { 'searchcount', 'encoding', 'fileformat', 'filetype' },
         lualine_y = { 'progress' },
         lualine_z = { 'location' }
       },

If I print out the string of "require('lsp-status').status()" where it reports errors, it looks like this (XHR.poll('<%=REQUEST_URI%>') callback)

matched with the error msg Error executing vim.schedule lua callback: ...e/nvim/lazy/lualine.nvim/lua/lualine/utils/nvim_opts.lua:77: E539: Illegal character <>>

The WA for me is like this...

require('lsp-status').status():gsub("%%", "")

liangkarl avatar Jul 03 '24 18:07 liangkarl