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

Commit 1fd3c14

Browse files
committed
update
1 parent 2a548ab commit 1fd3c14

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

lua/strive/init.lua

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,14 @@ function ProgressWindow:update_entry(plugin_name, status, message)
487487
}
488488

489489
if self.visible then
490-
-- Schedule UI updates to run in the main event loop
491-
vim.schedule(function()
490+
-- Only schedule if we're not already in main thread
491+
if vim.in_fast_event() then
492+
vim.schedule(function()
493+
self:refresh()
494+
end)
495+
else
492496
self:refresh()
493-
end)
497+
end
494498
end
495499

496500
return self
@@ -788,21 +792,28 @@ function Plugin:load_scripts(callback)
788792
return
789793
end
790794

795+
-- Collect all scripts first
796+
local scripts = {}
791797
while true do
792798
local name, type = uv.fs_scandir_next(result.value)
793799
if not name then
794800
break
795801
end
796802
if type == 'file' and (name:match('%.lua$') or name:match('%.vim$')) then
797-
local file_path = vim.fs.joinpath(plugin_dir, name)
798-
vim.schedule(function()
799-
vim.cmd('source ' .. vim.fn.fnameescape(file_path))
800-
if callback then
801-
callback()
802-
end
803-
end)
803+
table.insert(scripts, vim.fs.joinpath(plugin_dir, name))
804804
end
805805
end
806+
807+
if #scripts > 0 then
808+
vim.schedule(function()
809+
for _, file_path in ipairs(scripts) do
810+
vim.cmd('source ' .. vim.fn.fnameescape(file_path))
811+
end
812+
if callback then
813+
callback()
814+
end
815+
end)
816+
end
806817
end)()
807818
end
808819

0 commit comments

Comments
 (0)