Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Commit 1d63b39

Browse files
committed
feat(installer): skip local plugin
1 parent 0532e15 commit 1d63b39

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

bundle/nvim-plug/lua/plug/installer.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ function H.download_raw(plugSpec, force)
9292
return
9393
end
9494

95-
local cmd = {'curl', '-fLo', plugSpec.path, '--create-dirs', plugSpec.url}
96-
on_uidate(plugSpec.name, { command = 'curl'})
95+
local cmd = { 'curl', '-fLo', plugSpec.path, '--create-dirs', plugSpec.url }
96+
on_uidate(plugSpec.name, { command = 'curl' })
9797
local jobid = job.start(cmd, {
9898
on_exit = function(id, data, single)
9999
if data == 0 and single == 0 then
@@ -115,8 +115,6 @@ function H.download_raw(plugSpec, force)
115115
})
116116
processes = processes + 1
117117
jobs['jobid_' .. jobid] = plugSpec.name
118-
119-
120118
end
121119

122120
--- @param plugSpec PluginSpec
@@ -237,7 +235,9 @@ end
237235

238236
M.install = function(plugSpecs)
239237
for _, v in ipairs(plugSpecs) do
240-
if v.type == 'raw' then
238+
if v.is_local then
239+
on_uidate(v.name, {is_local = true})
240+
elseif v.type == 'raw' then
241241
H.download_raw(v)
242242
else
243243
H.install_plugin(v)
@@ -247,7 +247,9 @@ end
247247

248248
M.update = function(plugSpecs, force)
249249
for _, v in ipairs(plugSpecs) do
250-
if v.type == 'raw' then
250+
if v.is_local then
251+
on_uidate(v.name, {is_local = true})
252+
elseif v.type == 'raw' then
251253
H.download_raw(v, force)
252254
else
253255
H.update_plugin(v, force)

bundle/nvim-plug/lua/plug/loader.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ local config = require('plug.config')
1212
local add_raw_rtp = false
1313
local loaded_plugins = {}
1414

15-
1615
--- @class PluginSpec
1716
--- @field rtp string
1817
--- @field events table<string>
@@ -108,7 +107,11 @@ function M.parser(plugSpec)
108107
end
109108

110109
function M.load(plugSpec)
111-
if plugSpec.rtp and vim.fn.isdirectory(plugSpec.rtp) == 1 and not loaded_plugins[plugSpec.name] then
110+
if
111+
plugSpec.rtp
112+
and vim.fn.isdirectory(plugSpec.rtp) == 1
113+
and not loaded_plugins[plugSpec.name]
114+
then
112115
vim.opt.runtimepath:append(plugSpec.rtp)
113116
loaded_plugins[plugSpec.name] = true
114117
if type(plugSpec.config) == 'function' then

bundle/nvim-plug/lua/plug/ui.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ local plugin_status = {}
1717
local function count_done(p)
1818
done = 0
1919
for _, v in pairs(p) do
20-
if v.command and v[v.command .. '_done'] then
20+
if v.command and v[v.command .. '_done'] or v.is_local then
2121
done = done + 1
2222
end
2323
end
@@ -42,7 +42,9 @@ local function build_context()
4242
local b = base()
4343

4444
for k, plug in pairs(plugin_status) do
45-
if plug.command == 'pull' then
45+
if plug.is_local then
46+
table.insert(b, '' .. k .. ' skip local plugin')
47+
elseif plug.command == 'pull' then
4648
if plug.pull_done then
4749
table.insert(b, '' .. k .. ' updated')
4850
elseif plug.pull_done == false then

bundle/nvim-plug/test/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ require('plug').add({
4141
}
4242
}
4343
},
44+
{
45+
'D:/wsdjeg/winbar2.nvim',
46+
},
4447
{
4548
'wsdjeg/vim-async-dict',
4649
frozen = true,

0 commit comments

Comments
 (0)