fix: recursion loading random issue
This commit is contained in:
parent
9ff64a7b89
commit
130a1899c2
1 changed files with 7 additions and 0 deletions
|
|
@ -1,7 +1,12 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
local loading = false
|
||||||
|
|
||||||
---@return nil
|
---@return nil
|
||||||
function M.load()
|
function M.load()
|
||||||
|
if loading then return end
|
||||||
|
loading = true
|
||||||
|
|
||||||
if vim.g.colors_name then
|
if vim.g.colors_name then
|
||||||
vim.cmd('hi clear')
|
vim.cmd('hi clear')
|
||||||
end
|
end
|
||||||
|
|
@ -15,6 +20,8 @@ function M.load()
|
||||||
|
|
||||||
local theme = require('midnight.theme')
|
local theme = require('midnight.theme')
|
||||||
theme.apply()
|
theme.apply()
|
||||||
|
|
||||||
|
loading = false
|
||||||
end
|
end
|
||||||
|
|
||||||
---@deprecated Use `vim.cmd('colorscheme midnight')` instead
|
---@deprecated Use `vim.cmd('colorscheme midnight')` instead
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue