perf: remove async loading

This commit is contained in:
Folke Lemaitre 2021-06-19 18:55:40 +02:00
parent 825936964b
commit 6e1d4c2f37
No known key found for this signature in database
GPG Key ID: 707FE6FEB82F7984
2 changed files with 11 additions and 15 deletions

View File

@ -1,9 +1,9 @@
" clear cache so this reloads changes.
" useful for development
lua package.loaded['tokyonight'] = nil
lua package.loaded['tokyonight.theme'] = nil
lua package.loaded['tokyonight.colors'] = nil
lua package.loaded['tokyonight.util'] = nil
lua package.loaded['tokyonight.config'] = nil
" lua package.loaded['tokyonight'] = nil
" lua package.loaded['tokyonight.theme'] = nil
" lua package.loaded['tokyonight.colors'] = nil
" lua package.loaded['tokyonight.util'] = nil
" lua package.loaded['tokyonight.config'] = nil
lua require('tokyonight').colorscheme()

View File

@ -223,22 +223,18 @@ end
---@param theme Theme
function util.load(theme)
vim.cmd("hi clear")
if vim.fn.exists("syntax_on") then
vim.cmd("syntax reset")
end
-- if vim.fn.exists("syntax_on") then
-- vim.cmd("syntax reset")
-- end
vim.o.termguicolors = true
vim.g.colors_name = "tokyonight"
-- vim.api.nvim__set_hl_ns(ns)
-- load base theme
util.syntax(theme.base)
-- load syntax for plugins and terminal async
vim.defer_fn(function()
util.terminal(theme.colors)
util.syntax(theme.plugins)
util.terminal(theme.colors)
util.autocmds(theme.config)
end, 0)
end
---@param config Config