Skip to content

Commit

Permalink
fix(icons): update mock_nvim_web_devicons to define vim.g variable
Browse files Browse the repository at this point in the history
Resolve #1393
  • Loading branch information
echasnovski committed Dec 12, 2024
1 parent 636ab5c commit 21fec3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/mini/icons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ MiniIcons.mock_nvim_web_devicons = function()
else
package.loaded[modname] = M
end
vim.g.nvim_web_devicons = 1
end

--- Tweak built-in LSP kind names
Expand Down
3 changes: 3 additions & 0 deletions tests/test_icons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,9 @@ T['mock_nvim_web_devicons()']['works'] = function()
for _, method in ipairs(present) do
eq(child.lua_get('type(devicons.' .. method .. ')'), 'function')
end

-- Should set global variable which is set in 'plugin/nvim-web-devicons.vim'
eq(child.g.nvim_web_devicons, 1)
end

T['tweak_lsp_kind()'] = new_set({
Expand Down

0 comments on commit 21fec3b

Please sign in to comment.