Skip to content

Commit

Permalink
fix(cache): move setup guard before load call (#331)
Browse files Browse the repository at this point in the history
Having the `did_setup` value after the load function was causing cache
misses as the flag was not set even when calling setup before load.
  • Loading branch information
EdenEast committed Apr 11, 2023
1 parent 727a0ea commit 88182d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/nightfox/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ end

-- Avold g:colors_name reloading
local lock = false
local did_setup = false

function M.load(opts)
if lock then
Expand All @@ -62,12 +63,12 @@ function M.load(opts)
f = loadfile(compiled_file)
end

---@diagnostic disable-next-line: need-check-nil
f()

lock = false
end

local did_setup = false
function M.setup(opts)
did_setup = true
opts = opts or {}
Expand Down

0 comments on commit 88182d4

Please sign in to comment.