From b149eee571094f0c312a06d1dd959befcf203b0e Mon Sep 17 00:00:00 2001 From: Ryan King Date: Fri, 20 Aug 2021 09:19:48 -0400 Subject: [PATCH] do plugin highlighting synchronously --- README.md | 2 +- lua/nord/util.lua | 47 ++++++++++++++++++++--------------------------- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 557fb16..cc6bb5c 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ colorscheme nord ```lua --Lua: -require('nord').set() +vim.cmd[[colorscheme nord]] ``` To enable the `nord` theme for `Lualine`, simply specify it in your lualine settings: diff --git a/lua/nord/util.lua b/lua/nord/util.lua index 2e8cb93..14c54c7 100644 --- a/lua/nord/util.lua +++ b/lua/nord/util.lua @@ -42,32 +42,6 @@ function util.load() vim.o.termguicolors = true vim.g.colors_name = "nord" - -- Load plugins and lsp async - local async - async = vim.loop.new_async(vim.schedule_wrap(function () - nord.loadTerminal() - - -- imort tables for plugins and lsp - local plugins = nord.loadPlugins() - local lsp = nord.loadLSP() - - -- loop trough the plugins table and highlight every member - for group, colors in pairs(plugins) do - util.highlight(group, colors) - end - - -- loop trough the lsp table and highlight every member - for group, colors in pairs(lsp) do - util.highlight(group, colors) - end - - -- if contrast is enabled, apply it to sidebars and floating windows - if vim.g.nord_contrast == true then - util.contrast() - end - async:close() - end)) - -- load the most importaint parts of the theme local editor = nord.loadEditor() local syntax = nord.loadSyntax() @@ -88,7 +62,26 @@ function util.load() util.highlight(group, colors) end - async:send() + nord.loadTerminal() + + -- imort tables for plugins and lsp + local plugins = nord.loadPlugins() + local lsp = nord.loadLSP() + + -- loop trough the plugins table and highlight every member + for group, colors in pairs(plugins) do + util.highlight(group, colors) + end + + -- loop trough the lsp table and highlight every member + for group, colors in pairs(lsp) do + util.highlight(group, colors) + end + + -- if contrast is enabled, apply it to sidebars and floating windows + if vim.g.nord_contrast == true then + util.contrast() + end end return util -- 2.39.5