Skip to content

Commit 49af6e8

Browse files
committed
fix(init): don't need vim.schedule around setup
Not wrapping means vim cmds will be defined by the end of the setup call which is more predictable (and also makes lazy loading much easier)
1 parent eb96a18 commit 49af6e8

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

lua/opencode/init.lua

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
local M = {}
22

33
function M.setup(opts)
4-
vim.schedule(function()
5-
-- Have to setup config first, especially before state as
6-
-- it initializes at least one value (current_mode) from config.
7-
-- If state is require'd first then it will not get what may
8-
-- be set by the user
9-
local config = require('opencode.config')
10-
config.setup(opts)
4+
-- Have to setup config first, especially before state as
5+
-- it initializes at least one value (current_mode) from config.
6+
-- If state is require'd first then it will not get what may
7+
-- be set by the user
8+
local config = require('opencode.config')
9+
config.setup(opts)
1110

12-
require('opencode.core').setup()
13-
require('opencode.api').setup()
14-
require('opencode.keymap').setup(config.keymap)
15-
require('opencode.ui.completion').setup()
16-
require('opencode.event_manager').setup()
17-
end)
11+
require('opencode.core').setup()
12+
require('opencode.api').setup()
13+
require('opencode.keymap').setup(config.keymap)
14+
require('opencode.ui.completion').setup()
15+
require('opencode.event_manager').setup()
1816
end
1917

2018
return M

0 commit comments

Comments
 (0)