From eba121cc651413d753f688162413008a6ed455e2 Mon Sep 17 00:00:00 2001 From: LostNeophyte Date: Wed, 25 Jan 2023 11:06:39 +0100 Subject: refactor: use callbacks for configuring builtins --- lua/lvim/core/comment.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lua/lvim/core/comment.lua') diff --git a/lua/lvim/core/comment.lua b/lua/lvim/core/comment.lua index f07929c7..c75d402c 100644 --- a/lua/lvim/core/comment.lua +++ b/lua/lvim/core/comment.lua @@ -1,9 +1,7 @@ local M = {} function M.config() - lvim.builtin.comment = { - active = true, - on_config_done = nil, + local config = { ---Add a space b/w comment and the line ---@type boolean padding = true, @@ -72,15 +70,14 @@ function M.config() ---@type function|nil post_hook = nil, } + ---@cast config +LvimBuiltin + lvim.builtin.comment = config end function M.setup() local nvim_comment = require "Comment" nvim_comment.setup(lvim.builtin.comment) - if lvim.builtin.comment.on_config_done then - lvim.builtin.comment.on_config_done(nvim_comment) - end end return M -- cgit v1.2.3