From 130a1899c2d5a0af431f3e41eeac429e90ea1d09 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 10 Feb 2026 13:44:36 -0500 Subject: [PATCH] fix: recursion loading random issue --- lua/midnight/init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/midnight/init.lua b/lua/midnight/init.lua index 1055fda..670aaeb 100644 --- a/lua/midnight/init.lua +++ b/lua/midnight/init.lua @@ -1,7 +1,12 @@ local M = {} +local loading = false + ---@return nil function M.load() + if loading then return end + loading = true + if vim.g.colors_name then vim.cmd('hi clear') end @@ -15,6 +20,8 @@ function M.load() local theme = require('midnight.theme') theme.apply() + + loading = false end ---@deprecated Use `vim.cmd('colorscheme midnight')` instead