Skip to content

Commit

Permalink
plugins/comment-nvim: add {pre,post}Hook options
Browse files Browse the repository at this point in the history
  • Loading branch information
hoppla20 authored and GaetanLepage committed Jan 5, 2024
1 parent 856b88d commit 1f1065d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/utils/comment-nvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1f1065d

Please sign in to comment.