File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,20 @@ function M.load(plugins, reason)
110
110
--- @cast plugins (string | LazyPlugin )[]
111
111
112
112
for _ , plugin in pairs (plugins ) do
113
- plugin = type (plugin ) == " string" and Config .plugins [plugin ] or plugin
113
+ local try_load = true
114
+
115
+ if type (plugin ) == " string" then
116
+ if not Config .plugins [plugin ] then
117
+ Util .error (" Plugin " .. plugin .. " not found" )
118
+ try_load = false
119
+ else
120
+ plugin = Config .plugins [plugin ]
121
+ end
122
+ end
123
+
114
124
--- @cast plugin LazyPlugin
115
125
116
- if not plugin ._ .loaded then
126
+ if try_load and not plugin ._ .loaded then
117
127
--- @diagnostic disable-next-line : assign-type-mismatch
118
128
plugin ._ .loaded = {}
119
129
for k , v in pairs (reason ) do
@@ -137,7 +147,9 @@ function M.load(plugins, reason)
137
147
end
138
148
139
149
if plugin .dependencies then
140
- M .load (plugin .dependencies , {})
150
+ Util .try (function ()
151
+ M .load (plugin .dependencies , {})
152
+ end , " Failed to load deps for " .. plugin .name )
141
153
end
142
154
143
155
M .packadd (plugin .dir )
You can’t perform that action at this time.
0 commit comments