do plugin highlighting synchronously
authorRyan King <ryan.taylor.king@gmail.com>
Fri, 20 Aug 2021 13:19:48 +0000 (09:19 -0400)
committerRyan King <ryan.taylor.king@gmail.com>
Fri, 20 Aug 2021 13:19:48 +0000 (09:19 -0400)
README.md
lua/nord/util.lua

index 557fb16f39c43995cb9a2b8c65ebf15b3039ea57..cc6bb5cbe4b9e8cebe0c4ed7bd7a6a797b98a1ac 100644 (file)
--- 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:
index 2e8cb93107fc01bd870486aeb6787b56ee9b9192..14c54c7309fd135fb2c5ea98c72bc407766e77ab 100644 (file)
@@ -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