We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f34cb8 commit d8a5829Copy full SHA for d8a5829
lua/lazy/core/loader.lua
@@ -254,8 +254,27 @@ function M.reload(plugin)
254
end
255
256
257
+ -- reload any vimscript files for this plugin
258
+ local scripts = vim.fn.getscriptinfo({ name = ".vim" })
259
+ local loaded_scripts = {}
260
+ for _, s in ipairs(scripts) do
261
+ ---@type string
262
+ local path = s.name
263
+ if
264
+ path:sub(-4) == ".vim"
265
+ and path:find(plugin.dir, 1, true) == 1
266
+ and not path:find("/plugin/", 1, true)
267
+ and not path:find("/ftplugin/", 1, true)
268
+ then
269
+ loaded_scripts[#loaded_scripts + 1] = path
270
+ end
271
272
+
273
if load then
274
M.load(plugin, { start = "reload" })
275
+ for _, s in ipairs(loaded_scripts) do
276
+ M.source(s)
277
278
279
280
0 commit comments