fix: only save state when dirty

This commit is contained in:
Folke Lemaitre 2022-11-23 21:55:21 +01:00
parent 72d51cee9b
commit 32ca1c4bf8
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 5 additions and 2 deletions

View File

@ -4,9 +4,12 @@ local Module = require("lazy.core.module")
local M = {}
M.functions = { "init", "config", "run" }
M.changed = true
M.dirty = true
function M.save()
if not M.dirty then
return
end
local Config = require("lazy.core.config")
---@class LazyState
@ -114,7 +117,7 @@ function M.load()
local Loader = require("lazy.core.loader")
Loader.loaders = state.loaders
M.changed = false
M.dirty = false
return true
end