From 1f1065df1efa716686b9357b4b5e0e4fa4a0af7e Mon Sep 17 00:00:00 2001 From: "vincent.cui" Date: Thu, 28 Dec 2023 18:08:31 +0100 Subject: [PATCH] plugins/comment-nvim: add {pre,post}Hook options --- plugins/utils/comment-nvim.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/utils/comment-nvim.nix b/plugins/utils/comment-nvim.nix index fb18896d89..f14fd5f668 100644 --- a/plugins/utils/comment-nvim.nix +++ b/plugins/utils/comment-nvim.nix @@ -29,6 +29,8 @@ in { description = "Lines to be ignored while comment/uncomment"; default = null; }; + preHook = helpers.mkNullOrLuaFn "Lua function called before (un)comment."; + postHook = helpers.mkNullOrLuaFn "Lua function called after (un)comment."; toggler = mkOption { type = types.nullOr (types.submodule (_: { options = { @@ -94,6 +96,8 @@ in { config = let setupOptions = { inherit (cfg) padding sticky ignore toggler opleader mappings; + pre_hook = cfg.preHook; + post_hook = cfg.postHook; }; in mkIf cfg.enable {