Skip to content

Commit ce0cd6d

Browse files
authored
fix(pack): fix lua module/autoload not found by 'vim.schedule' (#199)
1 parent bf28119 commit ce0cd6d

File tree

3 files changed

+70
-3
lines changed

3 files changed

+70
-3
lines changed

lua/colorbox/timing.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local M = {}
55

66
M.startup = function()
77
vim.api.nvim_create_autocmd({ "VimEnter" }, {
8-
callback = policy.run,
8+
callback = vim.schedule_wrap(policy.run),
99
})
1010
end
1111

@@ -16,12 +16,12 @@ M.filetype = function()
1616
"WinEnter",
1717
"TermEnter",
1818
}, {
19-
callback = policy.run,
19+
callback = vim.schedule_wrap(policy.run),
2020
})
2121
end
2222

2323
M.fixed_interval = function()
24-
policy.run()
24+
vim.schedule_wrap(policy.run)()
2525
end
2626

2727
M.setup = function()

minimal_inits/lazy.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
vim.o.number = true
2+
vim.o.autoread = true
3+
vim.o.autowrite = true
4+
vim.o.swapfile = false
5+
vim.o.confirm = true
6+
7+
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
8+
if not vim.loop.fs_stat(lazypath) then
9+
vim.fn.system({
10+
"git",
11+
"clone",
12+
"--filter=blob:none",
13+
"https://github.com/folke/lazy.nvim.git",
14+
"--branch=stable", -- latest stable release
15+
lazypath,
16+
})
17+
end
18+
vim.opt.rtp:prepend(lazypath)
19+
20+
local opts = {
21+
defaults = { lazy = false },
22+
}
23+
24+
require("lazy").setup({
25+
{
26+
"linrongbin16/colorbox.nvim",
27+
opts = {},
28+
build = function()
29+
require("colorbox").update()
30+
end,
31+
},
32+
}, { dev = { path = "~/github/linrongbin16" }, defaults = { lazy = false } })

minimal_inits/pckr.lua

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
vim.o.number = true
2+
vim.o.autoread = true
3+
vim.o.autowrite = true
4+
vim.o.swapfile = false
5+
vim.o.confirm = true
6+
7+
local function bootstrap_pckr()
8+
local pckr_path = vim.fn.stdpath("data") .. "/pckr/pckr.nvim"
9+
10+
if not vim.loop.fs_stat(pckr_path) then
11+
vim.fn.system({
12+
"git",
13+
"clone",
14+
"--filter=blob:none",
15+
"https://github.com/lewis6991/pckr.nvim",
16+
pckr_path,
17+
})
18+
end
19+
20+
vim.opt.rtp:prepend(pckr_path)
21+
end
22+
23+
bootstrap_pckr()
24+
25+
require("pckr").add({
26+
{
27+
"~/github/linrongbin16/colorbox.nvim",
28+
config = function()
29+
require("colorbox").setup()
30+
end,
31+
run = function()
32+
require("colorbox").update()
33+
end,
34+
},
35+
})

0 commit comments

Comments
 (0)