fix(plugin): dont allow dir changes when we already loaded files from the plugin's old dir. Show an error in this case. Fixes #993

This commit is contained in:
Folke Lemaitre 2023-10-15 08:51:54 +02:00
parent 3dc413d6fd
commit c8e2091e6d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
3 changed files with 13 additions and 2 deletions

View file

@ -495,6 +495,7 @@ end
function M.auto_load(modname, modpath)
local plugin = Plugin.find(modpath)
if plugin and modpath:find(plugin.dir, 1, true) == 1 then
plugin._.rtp_loaded = true
-- don't load if we're loading specs or if the plugin is already loaded
if not (Plugin.loading or plugin._.loaded) then
if plugin.module == false then