Skip to content

Commit 66c902c

Browse files
authored
Merge pull request #8 from rootiest/v1.7.5
feat: implement asynchronous update check scheduling
2 parents d893ed0 + 178bde2 commit 66c902c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lua/nvim_updater/init.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,14 @@ function P.setup(user_config)
571571
-- Setup Neovim user commands
572572
P.setup_usercmds()
573573

574-
-- Check for updates
574+
-- Schedule async update check
575575
if P.default_config.check_for_updates then
576-
utils.get_commit_count()
577-
if P.default_config.update_interval > 0 then
578-
utils.update_timer(P.default_config.update_interval)
579-
end
576+
vim.defer_fn(function()
577+
utils.get_commit_count()
578+
if P.default_config.update_interval > 0 then
579+
utils.update_timer(P.default_config.update_interval)
580+
end
581+
end, 50)
580582
end
581583
end
582584

0 commit comments

Comments
 (0)