From 16e52715b70b4d0fc6af3563ccc0ed9df82ae23e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 23 Oct 2025 07:04:43 +0200 Subject: [PATCH] fix(plugin): check that path is actually in root dir. Closes #2075 --- lua/lazy/core/plugin.lua | 2 +- lua/lazy/manage/task/fs.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 37d1a8f..e58e754 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -240,7 +240,7 @@ function M.update_state() if plugin.virtual then plugin._.is_local = true plugin._.installed = true -- local plugins are managed by the user - elseif plugin.dir:find(Config.options.root, 1, true) == 1 then + elseif plugin.dir:find(Config.options.root .. "/", 1, true) == 1 then plugin._.installed = installed[plugin.name] ~= nil installed[plugin.name] = nil else diff --git a/lua/lazy/manage/task/fs.lua b/lua/lazy/manage/task/fs.lua index 41a18a8..327e808 100644 --- a/lua/lazy/manage/task/fs.lua +++ b/lua/lazy/manage/task/fs.lua @@ -25,7 +25,7 @@ M.clean = { run = function(self, opts) opts = opts or {} local dir = self.plugin.dir:gsub("/+$", "") - assert(dir:find(Config.options.root, 1, true) == 1, self.plugin.dir .. " should be under packpath!") + assert(dir:find(Config.options.root .. "/", 1, true) == 1, self.plugin.dir .. " should be under packpath!") local rock_root = Config.options.rocks.root .. "/" .. self.plugin.name if vim.uv.fs_stat(rock_root) then