Skip to content

Commit 0d6aac5

Browse files
committed
refactor: Improved load time
1 parent e700d6c commit 0d6aac5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plugin/patterns.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
vim.treesitter.language.register("lua_patterns", "LuaPatterns");
33
vim.treesitter.language.register("regex", "RegexPatterns");
44

5-
local patterns = require("patterns");
6-
75
--- Sets up the highlight groups.
86
--- Should be called AFTER loading
97
--- colorschemes.
10-
require("patterns.highlights").setup();
11-
12-
--- Updates the highlight groups.
13-
vim.api.nvim_create_autocmd("ColorScheme", {
8+
vim.api.nvim_create_autocmd({
9+
"VimEnter",
10+
"ColorScheme"
11+
}, {
1412
callback = function ()
1513
local hls = require("patterns.highlights");
1614
hls.create(hls.groups);
@@ -19,6 +17,8 @@ vim.api.nvim_create_autocmd("ColorScheme", {
1917

2018
--- User command.
2119
vim.api.nvim_create_user_command("Patterns", function (cmd)
20+
local patterns = require("patterns");
21+
2222
---@type string[]
2323
local args = cmd.fargs;
2424

0 commit comments

Comments
 (0)