From 2fa5be37796b8d40b1cd5cab9a4b4ae3a51ea524 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 29 Nov 2022 00:14:23 +0100 Subject: [PATCH] refactor(config): package_path => packpath --- lua/lazy/core/config.lua | 2 +- lua/lazy/core/plugin.lua | 6 +++--- lua/lazy/core/util.lua | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index 43836d1..0d2e255 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -12,7 +12,7 @@ M.defaults = { patterns = {}, }, interactive = true, - package_path = vim.fn.stdpath("data") .. "/site/pack/lazy", + packpath = vim.fn.stdpath("data") .. "/site/pack/lazy", view = { icons = { start = "", diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 7321425..2daa855 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -130,7 +130,7 @@ function M.update_state(check_clean) ---@type table<"opt"|"start", table> local installed = { opt = {}, start = {} } for opt, packs in pairs(installed) do - Util.ls(Config.options.package_path .. "/" .. opt, function(_, name, type) + Util.ls(Config.options.packpath .. "/" .. opt, function(_, name, type) if type == "directory" or type == "link" then packs[name] = type end @@ -144,7 +144,7 @@ function M.update_state(check_clean) plugin.opt = Config.options.opt end local opt = plugin.opt and "opt" or "start" - plugin.dir = Config.options.package_path .. "/" .. opt .. "/" .. plugin.name + plugin.dir = Config.options.packpath .. "/" .. opt .. "/" .. plugin.name plugin._.is_local = plugin.uri:sub(1, 4) ~= "http" and plugin.uri:sub(1, 3) ~= "git" plugin._.is_symlink = installed[opt][plugin.name] == "link" plugin._.installed = installed[opt][plugin.name] ~= nil @@ -160,7 +160,7 @@ function M.update_state(check_clean) table.insert(Config.to_clean, { name = pack, pack = pack, - dir = Config.options.package_path .. "/" .. opt .. "/" .. pack, + dir = Config.options.packpath .. "/" .. opt .. "/" .. pack, opt = opt == "opt", _ = { installed = true, diff --git a/lua/lazy/core/util.lua b/lua/lazy/core/util.lua index 0cda02b..f2c5b71 100644 --- a/lua/lazy/core/util.lua +++ b/lua/lazy/core/util.lua @@ -40,8 +40,8 @@ function M.try(fn, msg) end if info.what == "Lua" and not info.source:find("lazy.nvim") then local source = info.source:sub(2) - if source:find(Config.options.package_path, 1, true) == 1 then - source = source:sub(#Config.options.package_path + 1):gsub("^/opt/", ""):gsub("^/start/", "") + if source:find(Config.options.packpath, 1, true) == 1 then + source = source:sub(#Config.options.packpath + 1):gsub("^/opt/", ""):gsub("^/start/", "") end source = vim.fn.fnamemodify(source, ":p:~:.") local line = " - " .. source .. ":" .. info.currentline