@@ -7,13 +7,13 @@ M.functions = { "init", "config", "run" }
7
7
M .changed = true
8
8
9
9
function M .save ()
10
- local Config = require (" lazy.config" )
10
+ local Config = require (" lazy.core. config" )
11
11
12
12
--- @class LazyState
13
13
local state = {
14
14
--- @type LazyPlugin[]
15
15
plugins = {},
16
- loaders = require (" lazy.loader" ).loaders ,
16
+ loaders = require (" lazy.core. loader" ).loaders ,
17
17
config = Config .options ,
18
18
}
19
19
@@ -61,8 +61,8 @@ function M.load()
61
61
return false
62
62
end
63
63
64
- local Util = require (" lazy.util" )
65
- local Config = require (" lazy.config" )
64
+ local Util = require (" lazy.core. util" )
65
+ local Config = require (" lazy.core. config" )
66
66
67
67
if not vim .deep_equal (Config .options , state .config ) then
68
68
Cache .dirty ()
@@ -89,9 +89,7 @@ function M.load()
89
89
plugin .installed = installed [plugin .opt and " opt" or " start" ][plugin .pack ]
90
90
if plugin .modname then
91
91
-- mark module as used
92
- if not Cache .get (plugin .modname ) then
93
- Util .error (" Module missing for " .. plugin .name )
94
- end
92
+ assert (Cache .get (plugin .modname ))
95
93
for _ , fun in ipairs (M .functions ) do
96
94
if plugin [fun ] == true then
97
95
plugin [fun ] = function (...)
@@ -102,10 +100,7 @@ function M.load()
102
100
else
103
101
for _ , fun in ipairs (M .functions ) do
104
102
if type (plugin [fun ]) == " number" then
105
- local chunk = Cache .get (" cache.state.fun." .. plugin [fun ])
106
- if not chunk then
107
- Util .error (" Chunk missing for " .. plugin .name )
108
- end
103
+ local chunk = assert (Cache .get (" cache.state.fun." .. plugin [fun ]))
109
104
plugin [fun ] = function (...)
110
105
plugin [fun ] = loadstring (chunk )
111
106
return plugin [fun ](... )
@@ -116,7 +111,7 @@ function M.load()
116
111
end
117
112
118
113
-- loaders
119
- local Loader = require (" lazy.loader" )
114
+ local Loader = require (" lazy.core. loader" )
120
115
Loader .loaders = state .loaders
121
116
122
117
M .changed = false
0 commit comments