Skip to content

Commit

Permalink
fix(pack): fix lua module/autoload not found by 'vim.schedule' (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
linrongbin16 committed Feb 29, 2024
1 parent bf28119 commit ce0cd6d
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/colorbox/timing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local M = {}

M.startup = function()
vim.api.nvim_create_autocmd({ "VimEnter" }, {
callback = policy.run,
callback = vim.schedule_wrap(policy.run),
})
end

Expand All @@ -16,12 +16,12 @@ M.filetype = function()
"WinEnter",
"TermEnter",
}, {
callback = policy.run,
callback = vim.schedule_wrap(policy.run),
})
end

M.fixed_interval = function()
policy.run()
vim.schedule_wrap(policy.run)()
end

M.setup = function()
Expand Down
32 changes: 32 additions & 0 deletions minimal_inits/lazy.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
vim.o.number = true
vim.o.autoread = true
vim.o.autowrite = true
vim.o.swapfile = false
vim.o.confirm = true

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

local opts = {
defaults = { lazy = false },
}

require("lazy").setup({
{
"linrongbin16/colorbox.nvim",
opts = {},
build = function()
require("colorbox").update()
end,
},
}, { dev = { path = "~/github/linrongbin16" }, defaults = { lazy = false } })
35 changes: 35 additions & 0 deletions minimal_inits/pckr.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
vim.o.number = true
vim.o.autoread = true
vim.o.autowrite = true
vim.o.swapfile = false
vim.o.confirm = true

local function bootstrap_pckr()
local pckr_path = vim.fn.stdpath("data") .. "/pckr/pckr.nvim"

if not vim.loop.fs_stat(pckr_path) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/lewis6991/pckr.nvim",
pckr_path,
})
end

vim.opt.rtp:prepend(pckr_path)
end

bootstrap_pckr()

require("pckr").add({
{
"~/github/linrongbin16/colorbox.nvim",
config = function()
require("colorbox").setup()
end,
run = function()
require("colorbox").update()
end,
},
})

0 comments on commit ce0cd6d

Please sign in to comment.