Skip to content

Commit 68b8aa0

Browse files
committed
clean up
1 parent c86b7dc commit 68b8aa0

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

lua/strive/init.lua

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,7 @@ local function startuptime()
16501650
end
16511651

16521652
-- Set up auto-install with better event handling
1653-
local function setup_auto_install()
1653+
if DEFAULT_SETTINGS.auto_install then
16541654
-- Check if Neovim startup is already complete
16551655
-- When using strive in plugin folder
16561656
if vim.v.vim_did_enter == 1 then
@@ -1662,30 +1662,20 @@ local function setup_auto_install()
16621662
startuptime()
16631663
return
16641664
end
1665+
end
16651666

1666-
-- UI has not initialized yet, register for UIEnter event
1667-
api.nvim_create_autocmd('UIEnter', {
1668-
group = api.nvim_create_augroup('strive', { clear = false }),
1669-
callback = function()
1667+
api.nvim_create_autocmd('UIEnter', {
1668+
group = api.nvim_create_augroup('strive', { clear = false }),
1669+
once = true,
1670+
callback = function()
1671+
if DEFAULT_SETTINGS.auto_install then
16701672
vim.schedule(function()
16711673
M.log('debug', 'UIEnter triggered, installing plugins')
16721674
M.install()
16731675
end)
16741676
startuptime()
1675-
end,
1676-
once = true,
1677-
})
1678-
end
1679-
1680-
-- Setup auto-install if enabled
1681-
if DEFAULT_SETTINGS.auto_install then
1682-
setup_auto_install()
1683-
end
1677+
end
16841678

1685-
api.nvim_create_autocmd('UIEnter', {
1686-
group = api.nvim_create_augroup('strive', { clear = false }),
1687-
once = true,
1688-
callback = function()
16891679
vim.schedule(function()
16901680
api.nvim_exec_autocmds('User', {
16911681
pattern = 'StriveDone',

0 commit comments

Comments
 (0)