@@ -93,9 +93,12 @@ function Spec:log(msg, level)
93
93
self .notifs [# self .notifs + 1 ] = { msg = msg , level = level , file = self .importing }
94
94
end
95
95
96
- function Spec :report ()
96
+ function Spec :report (level )
97
+ level = level or vim .log .levels .ERROR
97
98
for _ , notif in ipairs (self .notifs ) do
98
- Util .notify (notif .msg , notif .level )
99
+ if notif .level >= level then
100
+ Util .notify (notif .msg , notif .level )
101
+ end
99
102
end
100
103
end
101
104
@@ -145,6 +148,7 @@ function Spec:import(spec)
145
148
end
146
149
147
150
Cache .indexed_unloaded = false
151
+ self .modules [# self .modules + 1 ] = spec .import
148
152
149
153
local imported = 0
150
154
Util .lsmod (spec .import , function (modname )
@@ -155,8 +159,7 @@ function Spec:import(spec)
155
159
--- @diagnostic disable-next-line : no-unknown
156
160
package.loaded [modname ] = nil
157
161
Util .try (function ()
158
- self :normalize (Cache .require (modname ))
159
- self .modules [# self .modules + 1 ] = modname
162
+ self :normalize (require (modname ))
160
163
self .importing = nil
161
164
Util .track ()
162
165
end , {
@@ -198,7 +201,7 @@ function Spec:merge(old, new)
198
201
end
199
202
else
200
203
old [k ] = v
201
- self :error ( " Merging plugins is not supported for key `" .. k .. " `\n " .. vim .inspect ({ old = old , new = new }))
204
+ self :warn ( " Overwriting key `" .. k .. " `\n " .. vim .inspect ({ old = old , new = new }))
202
205
end
203
206
else
204
207
--- @diagnostic disable-next-line : no-unknown
@@ -295,7 +298,7 @@ function M.find(path)
295
298
local slash = name :reverse ():find (" /" , 1 , true )
296
299
if slash then
297
300
name = name :sub (# name - slash + 2 )
298
- return name and Config .plugins [name ] or nil
301
+ return name and Config .spec . plugins [name ] or nil
299
302
end
300
303
end
301
304
end
0 commit comments