Skip to content

Commit 47691fc

Browse files
committed
chore: update load
1 parent 52b8580 commit 47691fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/strive/init.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ function Plugin:load(opts)
675675
end
676676

677677
self:packadd()
678-
self:load_scripts(opts and opts.script_cb or nil)
678+
self:load_scripts((opts and opts.script_cb) and opts.script_cb or nil)
679679
self:call_setup()
680680

681681
self.status = STATUS.LOADED
@@ -776,7 +776,7 @@ function Plugin:ft(filetypes)
776776
group = id,
777777
pattern = self.filetypes,
778778
once = true,
779-
callback = function(args)
779+
callback = function()
780780
if not self.loaded then
781781
self:load()
782782
end
@@ -808,14 +808,14 @@ function Plugin:load_scripts(callback)
808808
break
809809
end
810810
if type == 'file' and (name:match('%.lua$') or name:match('%.vim$')) then
811-
table.insert(scripts, vim.fs.joinpath(plugin_dir, name))
811+
scripts[#scripts + 1] = vim.fs.joinpath(plugin_dir, name)
812812
end
813813
end
814814

815815
if #scripts > 0 then
816816
vim.schedule(function()
817817
for _, file_path in ipairs(scripts) do
818-
vim.cmd('source ' .. vim.fn.fnameescape(file_path))
818+
vim.cmd.source(vim.fn.fnameescape(file_path))
819819
end
820820
if callback then
821821
callback()

0 commit comments

Comments
 (0)