Skip to content
This repository was archived by the owner on Aug 16, 2025. It is now read-only.

Commit 082e490

Browse files
authored
fix: wrap call to devicons in schedule_wrap (#102)
This is done so we can avoid the `nvim_get_hl must not be called in a lua loop callback` error. Should close #101
1 parent 5695712 commit 082e490

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/sidebar-nvim/builtin/git.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ local function parse_git_status(group, line)
7777
local fileicon = ""
7878

7979
if has_devicons and devicons.has_loaded() then
80-
local icon = devicons.get_icon_color(filepath, extension)
80+
local icon = vim.schedule_wrap(function()
81+
return devicons.get_icon_color(filepath, extension)
82+
end)()
8183
if icon then
8284
fileicon = icon
8385
end

0 commit comments

Comments
 (0)