From 1e2f5273bb61b660dd93651c4fc44d2c8c21b905 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 30 Nov 2022 23:05:51 +0100 Subject: [PATCH] fix: show proper installed/clean state for local plugins --- lua/lazy/manage/task/fs.lua | 4 ++++ lua/lazy/manage/task/git.lua | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lua/lazy/manage/task/fs.lua b/lua/lazy/manage/task/fs.lua index 5b4f3e5..b8097be 100644 --- a/lua/lazy/manage/task/fs.lua +++ b/lua/lazy/manage/task/fs.lua @@ -37,6 +37,8 @@ M.symlink = { if stat then assert(stat.type == "link") if vim.loop.fs_realpath(self.plugin.uri) == vim.loop.fs_realpath(self.plugin.dir) then + self.plugin._.installed = true + self.plugin._.cloned = true return else vim.loop.fs_unlink(self.plugin.dir) @@ -44,6 +46,8 @@ M.symlink = { end vim.loop.fs_symlink(self.plugin.uri, self.plugin.dir, { dir = true }) vim.opt.runtimepath:append(self.plugin.uri) + self.plugin._.installed = true + self.plugin._.cloned = true end, } diff --git a/lua/lazy/manage/task/git.lua b/lua/lazy/manage/task/git.lua index cef7e88..5a404ba 100644 --- a/lua/lazy/manage/task/git.lua +++ b/lua/lazy/manage/task/git.lua @@ -105,6 +105,7 @@ M.fetch = { skip = function(plugin) return not plugin._.installed or plugin._.is_local end, + run = function(self) local args = { "fetch", @@ -124,6 +125,7 @@ M.checkout = { skip = function(plugin) return not plugin._.installed or plugin._.is_local end, + ---@param opts {lockfile?:boolean} run = function(self, opts) local info = assert(Git.info(self.plugin.dir))