mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-12 02:12:30 +00:00
Compare commits
48 commits
Author | SHA1 | Date | |
---|---|---|---|
|
6c3bda4aca | ||
|
d51cf69783 | ||
|
1c9ba37045 | ||
|
96a205c8ce | ||
|
a8c6db5da7 | ||
|
e5e9bf4821 | ||
|
f81a3fb7fe | ||
|
ac21a639c7 | ||
|
c6a57a3534 | ||
|
f15a93907d | ||
|
7527af40dd | ||
|
5586fda88d | ||
|
4f30c61b64 | ||
|
d8f26efd45 | ||
|
4df5c4d65a | ||
|
72aa3a2624 | ||
|
a9c660d6ef | ||
|
7e6c863bc7 | ||
|
805b85c2ea | ||
|
7c493713bc | ||
|
b97ee167f5 | ||
|
703be1dda3 | ||
|
014d1d6d78 | ||
|
656cf43093 | ||
|
b08dba8107 | ||
|
ee64abc76b | ||
|
3388a26417 | ||
|
a44e9cd165 | ||
|
9570a5ae7b | ||
|
56ead98e05 | ||
|
7d0fe7615a | ||
|
8e11d208d6 | ||
|
25749704e4 | ||
|
e41dffcbaf | ||
|
7967abe557 | ||
|
60cf258a9a | ||
|
b1134ab82e | ||
|
408449a59a | ||
|
cf8ecc2c5e | ||
|
40dab7450e | ||
|
1159bdccd8 | ||
|
e9fd76e239 | ||
|
460e1cd8f2 | ||
|
aca30f6361 | ||
|
48b52b5cfc | ||
|
591ef40f2d | ||
|
80da254e64 | ||
|
014a72b7a8 |
20 changed files with 1963 additions and 146 deletions
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
".": "11.14.1"
|
||||
".": "11.17.1"
|
||||
}
|
||||
|
|
69
CHANGELOG.md
69
CHANGELOG.md
|
@ -1,5 +1,74 @@
|
|||
# Changelog
|
||||
|
||||
## [11.17.1](https://github.com/folke/lazy.nvim/compare/v11.17.0...v11.17.1) (2025-02-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bootstrap:** support for older Neovim versions ([1c9ba37](https://github.com/folke/lazy.nvim/commit/1c9ba3704564a2e34a22191bb89678680ffeb245))
|
||||
* **meta:** rebuild dirty right after disable. See [#1889](https://github.com/folke/lazy.nvim/issues/1889) ([d51cf69](https://github.com/folke/lazy.nvim/commit/d51cf6978321d659e68a8bc38ee806bd2517a196))
|
||||
|
||||
## [11.17.0](https://github.com/folke/lazy.nvim/compare/v11.16.2...v11.17.0) (2025-02-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config,render:** allow customizing the debug icon ([#1863](https://github.com/folke/lazy.nvim/issues/1863)) ([a9c660d](https://github.com/folke/lazy.nvim/commit/a9c660d6ef1b396869d3d951760aa7a3dbfe575f))
|
||||
* **util:** pass lang to `vim.notify` so that snacks notifier can render the ft. Closes [#1919](https://github.com/folke/lazy.nvim/issues/1919) ([c6a57a3](https://github.com/folke/lazy.nvim/commit/c6a57a3534d3494bcc5ff9b0586e141bdb0280eb))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **config:** add missing space on the default debug icon ([#1879](https://github.com/folke/lazy.nvim/issues/1879)) ([4df5c4d](https://github.com/folke/lazy.nvim/commit/4df5c4d65a3bbf801edd9ec55fb1ae55cfa72dd0))
|
||||
* **meta:** disable top-level specs before the rest. Closes [#1889](https://github.com/folke/lazy.nvim/issues/1889) ([f81a3fb](https://github.com/folke/lazy.nvim/commit/f81a3fb7feaf460ec7c8c983682b4a693b18fdd4))
|
||||
* **ui:** do not show virt_lines for messages ([#1904](https://github.com/folke/lazy.nvim/issues/1904)) ([f15a939](https://github.com/folke/lazy.nvim/commit/f15a93907ddad3d9139aea465ae18336d87f5ce6))
|
||||
|
||||
## [11.16.2](https://github.com/folke/lazy.nvim/compare/v11.16.1...v11.16.2) (2024-12-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **meta:** when a plugin is both optional and disabled, then just delete it from the list ([805b85c](https://github.com/folke/lazy.nvim/commit/805b85c2ea3bd6f9506ef22cbd6e3a39172b5b08))
|
||||
|
||||
## [11.16.1](https://github.com/folke/lazy.nvim/compare/v11.16.0...v11.16.1) (2024-12-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **types:** ensure all fields for `LazyPluginSpec` are optional ([#1843](https://github.com/folke/lazy.nvim/issues/1843)) ([703be1d](https://github.com/folke/lazy.nvim/commit/703be1dda35e142e76e94e7503cf67d6b98a1d35)), closes [#1842](https://github.com/folke/lazy.nvim/issues/1842)
|
||||
|
||||
## [11.16.0](https://github.com/folke/lazy.nvim/compare/v11.15.0...v11.16.0) (2024-12-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **plugin:** added support for virtual plugins. Closes [#1836](https://github.com/folke/lazy.nvim/issues/1836) ([ee64abc](https://github.com/folke/lazy.nvim/commit/ee64abc76be2b237b95d241a924b0323005b868a))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **plugin:** don't check if dir exists for virtual plugins ([656cf43](https://github.com/folke/lazy.nvim/commit/656cf4309396b7b8b62984e923bf8d8a0013f7d7))
|
||||
* **render:** show correct key for home. Fixes [#1796](https://github.com/folke/lazy.nvim/issues/1796) ([b08dba8](https://github.com/folke/lazy.nvim/commit/b08dba8107b5bdaaa007f18cf6c0cc0e0fd576aa))
|
||||
|
||||
## [11.15.0](https://github.com/folke/lazy.nvim/compare/v11.14.2...v11.15.0) (2024-12-05)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **plugin:** show error for local plugins that don't exist. Fixes [#1773](https://github.com/folke/lazy.nvim/issues/1773) ([9570a5a](https://github.com/folke/lazy.nvim/commit/9570a5ae7b17dcde4718c7458fd986c10f015a99))
|
||||
|
||||
## [11.14.2](https://github.com/folke/lazy.nvim/compare/v11.14.1...v11.14.2) (2024-11-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bootstrap:** single forward slash. Fixes [#1747](https://github.com/folke/lazy.nvim/issues/1747) ([aca30f6](https://github.com/folke/lazy.nvim/commit/aca30f63619a7492ecdea8833a065cf83c80f764))
|
||||
* **completion:** check if command string is a prefix of Lazy ([#1760](https://github.com/folke/lazy.nvim/issues/1760)) ([e9fd76e](https://github.com/folke/lazy.nvim/commit/e9fd76e239cc18da289f9a3f80f35fa16b003175)), closes [#1758](https://github.com/folke/lazy.nvim/issues/1758)
|
||||
* **docs:** always update helptags for local plugins ([60cf258](https://github.com/folke/lazy.nvim/commit/60cf258a9ae7fffe04bb31141141a91845158dcc))
|
||||
* **luarocks:** try to install from root manifest ([#1687](https://github.com/folke/lazy.nvim/issues/1687)) ([591ef40](https://github.com/folke/lazy.nvim/commit/591ef40f2da3a26fbcc0466988cd6fe45ca68cae))
|
||||
* **rocks:** add lib64 plugin directory to package.cpath ([#1717](https://github.com/folke/lazy.nvim/issues/1717)) ([80da254](https://github.com/folke/lazy.nvim/commit/80da254e645f579c28394ee0f08f75a9c9481744))
|
||||
* **rockspec:** allow binary lua files. Fixes [#1800](https://github.com/folke/lazy.nvim/issues/1800) ([408449a](https://github.com/folke/lazy.nvim/commit/408449a59adb8c2a31c32fff606676b32ce4552a))
|
||||
|
||||
## [11.14.1](https://github.com/folke/lazy.nvim/compare/v11.14.0...v11.14.1) (2024-07-25)
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
-- Lay Bootstrapper
|
||||
-- Lazy Bootstrapper
|
||||
-- Usage:
|
||||
-- ```lua
|
||||
-- load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
|
||||
|
@ -6,19 +6,20 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
local uv = vim.uv or vim.loop
|
||||
if vim.env.LAZY_STDPATH then
|
||||
local root = vim.fn.fnamemodify(vim.env.LAZY_STDPATH, ":p")
|
||||
local root = vim.fn.fnamemodify(vim.env.LAZY_STDPATH, ":p"):gsub("[\\/]$", "")
|
||||
for _, name in ipairs({ "config", "data", "state", "cache" }) do
|
||||
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
|
||||
end
|
||||
end
|
||||
|
||||
if vim.env.LAZY_PATH and not vim.uv.fs_stat(vim.env.LAZY_PATH) then
|
||||
if vim.env.LAZY_PATH and not uv.fs_stat(vim.env.LAZY_PATH) then
|
||||
vim.env.LAZY_PATH = nil
|
||||
end
|
||||
|
||||
local lazypath = vim.env.LAZY_PATH or vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.env.LAZY_PATH and not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
if not vim.env.LAZY_PATH and not uv.fs_stat(lazypath) then
|
||||
vim.api.nvim_echo({
|
||||
{
|
||||
"Cloning lazy.nvim\n\n",
|
||||
|
|
|
@ -540,9 +540,7 @@ function.
|
|||
keys = {
|
||||
{ "<leader>ft", "<cmd>Neotree toggle<cr>", desc = "NeoTree" },
|
||||
},
|
||||
config = function()
|
||||
require("neo-tree").setup()
|
||||
end,
|
||||
opts = {},
|
||||
}
|
||||
<
|
||||
|
||||
|
@ -646,24 +644,42 @@ will be added to the plugin’s spec.
|
|||
-- then set the below to false. This should work, but is NOT supported and will
|
||||
-- increase downloads a lot.
|
||||
filter = true,
|
||||
-- rate of network related git operations (clone, fetch, checkout)
|
||||
throttle = {
|
||||
enabled = false, -- not enabled by default
|
||||
-- max 2 ops every 5 seconds
|
||||
rate = 2,
|
||||
duration = 5 * 1000, -- in ms
|
||||
},
|
||||
-- Time in seconds to wait before running fetch again for a plugin.
|
||||
-- Repeated update/check operations will not run again until this
|
||||
-- cooldown period has passed.
|
||||
cooldown = 0,
|
||||
},
|
||||
pkg = {
|
||||
enabled = true,
|
||||
cache = vim.fn.stdpath("state") .. "/lazy/pkg-cache.lua",
|
||||
versions = true, -- Honor versions in pkg sources
|
||||
-- the first package source that is found for a plugin will be used.
|
||||
sources = {
|
||||
"lazy",
|
||||
"rockspec",
|
||||
"rockspec", -- will only be used when rocks.enabled is true
|
||||
"packspec",
|
||||
},
|
||||
},
|
||||
rocks = {
|
||||
enabled = true,
|
||||
root = vim.fn.stdpath("data") .. "/lazy-rocks",
|
||||
server = "https://nvim-neorocks.github.io/rocks-binaries/",
|
||||
-- use hererocks to install luarocks?
|
||||
-- set to `nil` to use hererocks when luarocks is not found
|
||||
-- set to `true` to always use hererocks
|
||||
-- set to `false` to always use luarocks
|
||||
hererocks = nil,
|
||||
},
|
||||
dev = {
|
||||
---@type string | fun(plugin: LazyPlugin): string directory where you store your local plugin projects
|
||||
-- Directory where you store your local plugin projects. If a function is used,
|
||||
-- the plugin directory (e.g. `~/projects/plugin-name`) must be returned.
|
||||
---@type string | fun(plugin: LazyPlugin): string
|
||||
path = "~/projects",
|
||||
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
|
||||
patterns = {}, -- For example {"folke"}
|
||||
|
@ -690,6 +706,7 @@ will be added to the plugin’s spec.
|
|||
icons = {
|
||||
cmd = " ",
|
||||
config = "",
|
||||
debug = "● ",
|
||||
event = " ",
|
||||
favorite = " ",
|
||||
ft = " ",
|
||||
|
@ -715,7 +732,7 @@ will be added to the plugin’s spec.
|
|||
-- leave nil, to automatically select a browser depending on your OS.
|
||||
-- If you want to use a specific browser, you can define it here
|
||||
browser = nil, ---@type string?
|
||||
throttle = 20, -- how frequently should the ui process render events
|
||||
throttle = 1000 / 30, -- how frequently should the ui process render events
|
||||
custom_keys = {
|
||||
-- You can define custom key maps here. If present, the description will
|
||||
-- be shown in the help menu.
|
||||
|
@ -730,6 +747,16 @@ will be added to the plugin’s spec.
|
|||
desc = "Open lazygit log",
|
||||
},
|
||||
|
||||
["<localleader>i"] = {
|
||||
function(plugin)
|
||||
Util.notify(vim.inspect(plugin), {
|
||||
title = "Inspect " .. plugin.name,
|
||||
lang = "lua",
|
||||
})
|
||||
end,
|
||||
desc = "Inspect Plugin",
|
||||
},
|
||||
|
||||
["<localleader>t"] = {
|
||||
function(plugin)
|
||||
require("lazy.util").float_term(nil, {
|
||||
|
@ -740,6 +767,17 @@ will be added to the plugin’s spec.
|
|||
},
|
||||
},
|
||||
},
|
||||
-- Output options for headless mode
|
||||
headless = {
|
||||
-- show the output from process commands like git
|
||||
process = true,
|
||||
-- show log messages
|
||||
log = true,
|
||||
-- show task start/end
|
||||
task = true,
|
||||
-- use ansi colors
|
||||
colors = true,
|
||||
},
|
||||
diff = {
|
||||
-- diff command <d> can be one of:
|
||||
-- * browser: opens the github compare view. Note that this is always mapped to <K> as well,
|
||||
|
@ -791,7 +829,7 @@ will be added to the plugin’s spec.
|
|||
enabled = true,
|
||||
root = vim.fn.stdpath("state") .. "/lazy/readme",
|
||||
files = { "README.md", "lua/**/README.md" },
|
||||
-- only generate markdown helptags for plugins that dont have docs
|
||||
-- only generate markdown helptags for plugins that don't have docs
|
||||
skip_if_doc_exists = true,
|
||||
},
|
||||
state = vim.fn.stdpath("state") .. "/lazy/state.json", -- state info for checker and other things
|
||||
|
@ -837,6 +875,8 @@ If you don’t want to use a Nerd Font, you can replace the icons with Unicode s
|
|||
-----------------------------------------------------------------------
|
||||
Highlight Group Default Group Description
|
||||
----------------------- ----------------------- -----------------------
|
||||
LazyBold { bold = true }
|
||||
|
||||
LazyButton CursorLine
|
||||
|
||||
LazyButtonActive Visual
|
||||
|
@ -857,10 +897,16 @@ If you don’t want to use a Nerd Font, you can replace the icons with Unicode s
|
|||
|
||||
LazyDir @markup.link directory
|
||||
|
||||
LazyError DiagnosticError task errors
|
||||
|
||||
LazyH1 IncSearch home button
|
||||
|
||||
LazyH2 Bold titles
|
||||
|
||||
LazyInfo DiagnosticInfo task errors
|
||||
|
||||
LazyItalic { italic = true }
|
||||
|
||||
LazyLocal Constant
|
||||
|
||||
LazyNoCond DiagnosticWarn unloaded icon for a
|
||||
|
@ -897,13 +943,13 @@ If you don’t want to use a Nerd Font, you can replace the icons with Unicode s
|
|||
|
||||
LazySpecial @punctuation.special
|
||||
|
||||
LazyTaskError ErrorMsg task errors
|
||||
|
||||
LazyTaskOutput MsgArea task output
|
||||
|
||||
LazyUrl @markup.link url
|
||||
|
||||
LazyValue @string value of a property
|
||||
|
||||
LazyWarning DiagnosticWarn task errors
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
==============================================================================
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -67,7 +67,9 @@ M.defaults = {
|
|||
hererocks = nil,
|
||||
},
|
||||
dev = {
|
||||
---@type string | fun(plugin: LazyPlugin): string directory where you store your local plugin projects
|
||||
-- Directory where you store your local plugin projects. If a function is used,
|
||||
-- the plugin directory (e.g. `~/projects/plugin-name`) must be returned.
|
||||
---@type string | fun(plugin: LazyPlugin): string
|
||||
path = "~/projects",
|
||||
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
|
||||
patterns = {}, -- For example {"folke"}
|
||||
|
@ -94,6 +96,7 @@ M.defaults = {
|
|||
icons = {
|
||||
cmd = " ",
|
||||
config = "",
|
||||
debug = "● ",
|
||||
event = " ",
|
||||
favorite = " ",
|
||||
ft = " ",
|
||||
|
@ -216,7 +219,7 @@ M.defaults = {
|
|||
enabled = true,
|
||||
root = vim.fn.stdpath("state") .. "/lazy/readme",
|
||||
files = { "README.md", "lua/**/README.md" },
|
||||
-- only generate markdown helptags for plugins that dont have docs
|
||||
-- only generate markdown helptags for plugins that don't have docs
|
||||
skip_if_doc_exists = true,
|
||||
},
|
||||
state = vim.fn.stdpath("state") .. "/lazy/state.json", -- state info for checker and other things
|
||||
|
@ -239,7 +242,7 @@ function M.hererocks()
|
|||
return M.options.rocks.hererocks
|
||||
end
|
||||
|
||||
M.version = "11.14.1" -- x-release-please-version
|
||||
M.version = "11.17.1" -- x-release-please-version
|
||||
|
||||
M.ns = vim.api.nvim_create_namespace("lazy")
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ local Util = require("lazy.core.util")
|
|||
|
||||
---@class LazyKeysSpec: LazyKeysBase
|
||||
---@field [1] string lhs
|
||||
---@field [2]? string|fun()|false rhs
|
||||
---@field [2]? string|fun():string?|false rhs
|
||||
---@field mode? string|string[]
|
||||
|
||||
---@class LazyKeys: LazyKeysBase
|
||||
|
|
|
@ -341,7 +341,9 @@ function M._load(plugin, reason, opts)
|
|||
Util.track({ plugin = plugin.name, start = reason.start })
|
||||
Handler.disable(plugin)
|
||||
|
||||
M.add_to_rtp(plugin)
|
||||
if not plugin.virtual then
|
||||
M.add_to_rtp(plugin)
|
||||
end
|
||||
|
||||
if plugin._.pkg and plugin._.pkg.source == "rockspec" then
|
||||
M.add_to_luapath(plugin)
|
||||
|
@ -353,7 +355,9 @@ function M._load(plugin, reason, opts)
|
|||
end, "Failed to load deps for " .. plugin.name)
|
||||
end
|
||||
|
||||
M.packadd(plugin.dir)
|
||||
if not plugin.virtual then
|
||||
M.packadd(plugin.dir)
|
||||
end
|
||||
if plugin.config or plugin.opts then
|
||||
M.config(plugin)
|
||||
end
|
||||
|
@ -493,8 +497,11 @@ function M.add_to_luapath(plugin)
|
|||
local root = Config.options.rocks.root .. "/" .. plugin.name
|
||||
local path = root .. "/share/lua/5.1"
|
||||
local cpath = root .. "/lib/lua/5.1"
|
||||
local cpath2 = root .. "/lib64/lua/5.1"
|
||||
|
||||
package.path = package.path .. ";" .. path .. "/?.lua;" .. path .. "/?/init.lua;"
|
||||
package.cpath = package.cpath .. ";" .. cpath .. "/?." .. (jit.os:find("Windows") and "dll" or "so") .. ";"
|
||||
package.cpath = package.cpath .. ";" .. cpath2 .. "/?." .. (jit.os:find("Windows") and "dll" or "so") .. ";"
|
||||
end
|
||||
|
||||
function M.source(path)
|
||||
|
|
|
@ -179,6 +179,7 @@ function M:_rebuild(name)
|
|||
local super = nil
|
||||
plugin.url = nil
|
||||
plugin._.dep = true
|
||||
plugin._.top = true
|
||||
plugin.optional = true
|
||||
|
||||
assert(#plugin._.frags > 0, "no fragments found for plugin " .. name)
|
||||
|
@ -195,6 +196,7 @@ function M:_rebuild(name)
|
|||
plugin._.dep = plugin._.dep and fragment.dep
|
||||
plugin.optional = plugin.optional and (rawget(fragment.spec, "optional") == true)
|
||||
plugin.url = fragment.url or plugin.url
|
||||
plugin._.top = plugin._.top and fragment.pid == nil
|
||||
|
||||
-- dependencies
|
||||
for _, dep in ipairs(fragment.deps or {}) do
|
||||
|
@ -213,6 +215,8 @@ function M:_rebuild(name)
|
|||
plugin.dir = super.dir
|
||||
if plugin.dir then
|
||||
plugin.dir = Util.norm(plugin.dir)
|
||||
elseif super.virtual then
|
||||
plugin.dir = Util.norm("/dev/null/" .. plugin.name)
|
||||
else
|
||||
if plugin.dev == nil and plugin.url then
|
||||
for _, pattern in ipairs(Config.options.dev.patterns) do
|
||||
|
@ -300,13 +304,26 @@ end
|
|||
--- Removes plugins that are disabled.
|
||||
function M:fix_disabled()
|
||||
local changes = 0
|
||||
for _, plugin in pairs(self.plugins) do
|
||||
if plugin.enabled == false or (type(plugin.enabled) == "function" and not plugin.enabled()) then
|
||||
changes = changes + 1
|
||||
self:disable(plugin)
|
||||
local function check(top)
|
||||
for _, plugin in pairs(self.plugins) do
|
||||
if (plugin._.top or false) == top then
|
||||
if plugin.enabled == false or (type(plugin.enabled) == "function" and not plugin.enabled()) then
|
||||
changes = changes + 1
|
||||
if plugin.optional then
|
||||
self:del(plugin.name)
|
||||
else
|
||||
self:disable(plugin)
|
||||
end
|
||||
self:rebuild()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
self:rebuild()
|
||||
-- disable top-level plugins first, since they may have non-top-level frags
|
||||
-- that disable other plugins
|
||||
check(true)
|
||||
-- then disable non-top-level plugins
|
||||
check(false)
|
||||
return changes
|
||||
end
|
||||
|
||||
|
|
|
@ -237,12 +237,15 @@ function M.update_state()
|
|||
or plugin.cmd
|
||||
plugin.lazy = lazy and true or false
|
||||
end
|
||||
if plugin.dir:find(Config.options.root, 1, true) == 1 then
|
||||
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
|
||||
plugin._.installed = installed[plugin.name] ~= nil
|
||||
installed[plugin.name] = nil
|
||||
else
|
||||
plugin._.is_local = true
|
||||
plugin._.installed = true -- local plugins are managed by the user
|
||||
plugin._.installed = vim.fn.isdirectory(plugin.dir) == 1
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -270,7 +270,7 @@ function M.get_unloaded_rtp(modname, opts)
|
|||
local Config = require("lazy.core.config")
|
||||
if Config.spec then
|
||||
for _, plugin in pairs(Config.spec.plugins) do
|
||||
if not (plugin._.loaded or plugin.module == false) then
|
||||
if not (plugin._.loaded or plugin.module == false or plugin.virtual) then
|
||||
if norm == M.normname(plugin.name) then
|
||||
table.insert(rtp, 1, plugin.dir)
|
||||
else
|
||||
|
@ -374,6 +374,7 @@ function M.notify(msg, opts)
|
|||
local lang = opts.lang or "markdown"
|
||||
local n = opts.once and vim.notify_once or vim.notify
|
||||
n(msg, opts.level or vim.log.levels.INFO, {
|
||||
ft = lang,
|
||||
on_open = function(win)
|
||||
local ok = pcall(function()
|
||||
vim.treesitter.language.add("markdown")
|
||||
|
|
|
@ -131,7 +131,8 @@ function M.colors(opts)
|
|||
{ "---", "---", "---" },
|
||||
}
|
||||
Util.foreach(require(opts.modname).colors, function(group, link)
|
||||
lines[#lines + 1] = { "**" .. opts.name .. group .. "**", "***" .. link .. "***", comments[group] or "" }
|
||||
link = type(link) == "table" and "`" .. vim.inspect(link):gsub("%s+", " ") .. "`" or "***" .. link .. "***"
|
||||
lines[#lines + 1] = { "**" .. opts.name .. group .. "**", link, comments[group] or "" }
|
||||
end)
|
||||
return { content = M.table(lines) }
|
||||
end
|
||||
|
|
|
@ -80,6 +80,7 @@ function M.install(opts)
|
|||
opts = M.opts(opts, { mode = "install" })
|
||||
return M.run({
|
||||
pipeline = {
|
||||
"plugin.exists",
|
||||
"git.clone",
|
||||
{ "git.checkout", lockfile = opts.lockfile },
|
||||
"plugin.docs",
|
||||
|
@ -108,6 +109,7 @@ function M.update(opts)
|
|||
opts = M.opts(opts, { mode = "update" })
|
||||
return M.run({
|
||||
pipeline = {
|
||||
"plugin.exists",
|
||||
"git.origin",
|
||||
"git.branch",
|
||||
"git.fetch",
|
||||
|
@ -147,6 +149,7 @@ function M.check(opts)
|
|||
opts = opts or {}
|
||||
return M.run({
|
||||
pipeline = {
|
||||
"plugin.exists",
|
||||
{ "git.origin", check = true },
|
||||
"git.fetch",
|
||||
"git.status",
|
||||
|
|
|
@ -335,7 +335,7 @@ M.checkout = {
|
|||
end
|
||||
end
|
||||
|
||||
-- dont run checkout if target is already reached.
|
||||
-- don't run checkout if target is already reached.
|
||||
-- unless we just cloned, since then we won't have any data yet
|
||||
if Git.eq(info, target) and info.branch == target.branch then
|
||||
self.plugin._.updated = {
|
||||
|
|
|
@ -87,7 +87,7 @@ M.build = {
|
|||
|
||||
M.docs = {
|
||||
skip = function(plugin)
|
||||
return not plugin._.dirty
|
||||
return not plugin._.is_local and not plugin._.dirty
|
||||
end,
|
||||
run = function(self)
|
||||
local docs = self.plugin.dir .. "/doc"
|
||||
|
@ -97,4 +97,15 @@ M.docs = {
|
|||
end,
|
||||
}
|
||||
|
||||
M.exists = {
|
||||
skip = function(plugin)
|
||||
return not plugin._.is_local or plugin.virtual
|
||||
end,
|
||||
run = function(self)
|
||||
if not Util.file_exists(self.plugin.dir) then
|
||||
self:error("Local plugin does not exist at `" .. self.plugin.dir .. "`")
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
return M
|
||||
|
|
|
@ -172,7 +172,6 @@ function M.build(task)
|
|||
root,
|
||||
"--server",
|
||||
Config.options.rocks.server,
|
||||
"--dev",
|
||||
"--lua-version",
|
||||
"5.1",
|
||||
"install", -- use install so that we can make use of pre-built rocks
|
||||
|
@ -225,9 +224,10 @@ end
|
|||
---@return table?
|
||||
function M.parse(file)
|
||||
local ret = {}
|
||||
return pcall(function()
|
||||
loadfile(file, "t", ret)()
|
||||
local ok = pcall(function()
|
||||
loadfile(file, nil, ret)()
|
||||
end) and ret or nil
|
||||
return ok and ret or nil
|
||||
end
|
||||
|
||||
---@param plugin LazyPlugin
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
---@field dirty? boolean
|
||||
---@field build? boolean
|
||||
---@field frags? number[]
|
||||
---@field top? boolean
|
||||
---@field handlers? LazyPluginHandlers
|
||||
---@field installed? boolean
|
||||
---@field is_local? boolean
|
||||
|
@ -60,6 +61,7 @@
|
|||
---@field priority? number Only useful for lazy=false plugins to force loading certain plugins first. Default priority is 50
|
||||
---@field dev? boolean If set, then link to the respective folder under your ~/projects
|
||||
---@field rocks? string[]
|
||||
---@field virtual? boolean virtual plugins won't be installed or added to the rtp.
|
||||
|
||||
---@class LazyPlugin: LazyPluginBase,LazyPluginHandlers,LazyPluginHooks,LazyPluginRef
|
||||
---@field dependencies? string[]
|
||||
|
@ -74,6 +76,8 @@
|
|||
---@field module? false
|
||||
|
||||
---@class LazyPluginSpec: LazyPluginBase,LazyPluginSpecHandlers,LazyPluginHooks,LazyPluginRef
|
||||
---@field name? string display name and name used for plugin config files
|
||||
---@field dir? string
|
||||
---@field dependencies? string|string[]|LazyPluginSpec[]
|
||||
---@field specs? string|string[]|LazyPluginSpec[]
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ end
|
|||
---@return string, string[]
|
||||
function M.parse(args)
|
||||
local parts = vim.split(vim.trim(args), "%s+")
|
||||
if parts[1]:find("Lazy") then
|
||||
if vim.startswith("Lazy", parts[1]) then
|
||||
table.remove(parts, 1)
|
||||
end
|
||||
if args:sub(-1) == " " then
|
||||
|
|
|
@ -94,7 +94,7 @@ function M:update()
|
|||
diag.lnum = diag.row - 1
|
||||
return diag
|
||||
end, self._diagnostics),
|
||||
{ signs = false, virtual_text = true, underline = false }
|
||||
{ signs = false, virtual_text = true, underline = false, virtual_lines = false }
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -144,8 +144,6 @@ function M:title()
|
|||
if mode.name == "home" then
|
||||
if self.view.state.mode == "home" then
|
||||
title = " lazy.nvim " .. Config.options.ui.icons.lazy
|
||||
else
|
||||
title = " lazy.nvim (H) "
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -761,7 +759,7 @@ function M:debug()
|
|||
---@type string[]
|
||||
plugins = vim.tbl_values(plugins)
|
||||
table.sort(plugins)
|
||||
self:append("● ", "LazySpecial", { indent = 2 })
|
||||
self:append(Config.options.ui.icons.debug, "LazySpecial", { indent = 2 })
|
||||
if handler_type == "keys" then
|
||||
for k, v in pairs(Config.plugins[plugins[1]]._.handlers.keys) do
|
||||
if k == value then
|
||||
|
|
|
@ -25,6 +25,7 @@ local function clean(plugins)
|
|||
if plugin._.dep == false then
|
||||
plugin._.dep = nil
|
||||
end
|
||||
plugin._.top = nil
|
||||
return plugin
|
||||
end, plugins)
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue