From 6e1d4c2f377fe7ed0a833b85d5e6f2f612eda176 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 19 Jun 2021 18:55:40 +0200 Subject: [PATCH] perf: remove async loading --- colors/tokyonight.vim | 10 +++++----- lua/tokyonight/util.lua | 16 ++++++---------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/colors/tokyonight.vim b/colors/tokyonight.vim index dcb36ea..8917c06 100644 --- a/colors/tokyonight.vim +++ b/colors/tokyonight.vim @@ -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() diff --git a/lua/tokyonight/util.lua b/lua/tokyonight/util.lua index f174d83..b4120d6 100644 --- a/lua/tokyonight/util.lua +++ b/lua/tokyonight/util.lua @@ -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.autocmds(theme.config) - end, 0) + util.syntax(theme.plugins) + util.terminal(theme.colors) + util.autocmds(theme.config) end ---@param config Config