From 21d076c13aa1af0cc1e2d88b2e19f2c01dfc44fa Mon Sep 17 00:00:00 2001 From: Arjun Mahishi Date: Fri, 1 Aug 2025 11:43:58 +0530 Subject: [PATCH] fix(plugin): protect dev plugins from cleanup Dev plugins with local directories should not be deleted during cleanup operations, even when located within the lazy root directory. This enables the workflow of developing plugins locally in the same location where they would be installed from upstream. --- lua/lazy/core/plugin.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 37d1a8f..8971c72 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -237,7 +237,7 @@ function M.update_state() or plugin.cmd plugin.lazy = lazy and true or false end - if plugin.virtual then + if plugin.virtual or (plugin.dev and plugin.dir ~= "") 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