From 32ca1c4bf875b10776ad8a928e43df290d11cd42 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 23 Nov 2022 21:55:21 +0100 Subject: [PATCH] fix: only save state when dirty --- lua/lazy/core/state.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/lazy/core/state.lua b/lua/lazy/core/state.lua index 67661cf..36ab151 100644 --- a/lua/lazy/core/state.lua +++ b/lua/lazy/core/state.lua @@ -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