From 447e51d96463dac1748ab0209bdbdfc25cfc41ff Mon Sep 17 00:00:00 2001 From: Cormac Relf Date: Thu, 17 Sep 2020 23:20:08 +1000 Subject: [PATCH] Apply changes to run() better --- lua/dark_notify.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lua/dark_notify.lua b/lua/dark_notify.lua index 96e1f78..975533f 100644 --- a/lua/dark_notify.lua +++ b/lua/dark_notify.lua @@ -146,10 +146,15 @@ function run(config) conf.schemes = schemes end) - if not get_config().initialized then + local config = get_config() + if not config.initialized then + -- first run on startup, also happens to apply current mode init_dark_notify() - else - apply_current_mode() + elseif config.current_mode ~= nil then + -- we have run it before, but we're updating the settings + -- so don't reset to system, but do apply changed config. + local mode = config.current_mode + apply_mode(mode) end end