Hello, I've noticed that nvim-web-deviconsget_icon_* pollutes vim command output with what seems to be a spurious execution of :hi <hl_group> with no arguments. This causes problems when using the :redir command because get_icon_* functions are usually called by statusline plugins, which fire while :redir is registering the output of a command.
steps to reproduce:
:redir @a
:lua =require("nvim-web-devicons").get_icon_color('test.py', 'py')
:redir END
:echo @a
Hello, I've noticed that
nvim-web-devicons
get_icon_*
pollutes vim command output with what seems to be a spurious execution of:hi <hl_group>
with no arguments. This causes problems when using the:redir
command becauseget_icon_*
functions are usually called by statusline plugins, which fire while:redir
is registering the output of a command.steps to reproduce:
produces
expected behaviour
the snippet above should only produce
solution
I think this is the offending line
https://github.com/nvim-tree/nvim-web-devicons/blob/9061e2d355ecaa2b588b71a35e7a11358a7e51e1/lua/nvim-web-devicons.lua#L1656
I think cterm color could be retrieved using, for example,
nvim_get_hl_by_name('DevIconPy', false).foreground