summaryrefslogtreecommitdiff
path: root/lua/lvim/core/comment.lua
diff options
context:
space:
mode:
authorLostNeophyte <[email protected]>2023-01-25 11:06:39 +0100
committerLostNeophyte <[email protected]>2023-01-25 11:11:25 +0100
commiteba121cc651413d753f688162413008a6ed455e2 (patch)
tree737757af86e0be6a2517e4ad21fffb859621494f /lua/lvim/core/comment.lua
parent4b9f4b2ae6dfc034ba10abab5ab91c357c058734 (diff)
refactor: use callbacks for configuring builtins
Diffstat (limited to 'lua/lvim/core/comment.lua')
-rw-r--r--lua/lvim/core/comment.lua9
1 files changed, 3 insertions, 6 deletions
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