Skip to content

Commit

Permalink
perf: defer settings up todo-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Sep 10, 2022
1 parent a57b18c commit 5e84162
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lua/todo-comments/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ local defaults = {
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" }
test = { "Identifier", "#FF00FF" },
},
search = {
command = "rg",
Expand All @@ -80,12 +80,9 @@ M._options = nil

function M.setup(options)
M._options = options
-- lazy load setup after VimEnter
if vim.api.nvim_get_vvar("vim_did_enter") == 0 then
vim.cmd([[autocmd VimEnter * ++once lua require("todo-comments.config")._setup()]])
else
vim.defer_fn(function()
M._setup()
end
end, 0)
end

function M._setup()
Expand Down

0 comments on commit 5e84162

Please sign in to comment.