lib: remove helpers from internal usage

This commit is contained in:
Matt Sturgeon 2024-09-29 14:41:41 +01:00
parent 2c4e4681db
commit cd76b4feb8
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
7 changed files with 38 additions and 39 deletions

View file

@ -1,6 +1,7 @@
{ lib, helpers }:
{ lib }:
let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts;
in
rec {
autoGroupOption = types.submodule {
@ -14,34 +15,34 @@ rec {
};
autoCmdOptions = {
event = helpers.mkNullOrOption (with types; either str (listOf str)) ''
event = lib.nixvim.mkNullOrOption (with types; either str (listOf str)) ''
The event or events to register this autocommand.
'';
group = helpers.mkNullOrOption (with types; either str int) ''
group = lib.nixvim.mkNullOrOption (with types; either str int) ''
The autocommand group name or id to match against.
'';
pattern = helpers.mkNullOrOption (with types; either str (listOf str)) ''
pattern = lib.nixvim.mkNullOrOption (with types; either str (listOf str)) ''
Pattern or patterns to match literally against.
'';
buffer = helpers.mkNullOrOption types.int ''
buffer = lib.nixvim.mkNullOrOption types.int ''
Buffer number for buffer local autocommands |autocmd-buflocal|.
Cannot be used with `pattern`.
'';
# Introduced early October 2023.
# TODO remove in early December 2023.
description = helpers.mkNullOrOption types.str ''
description = lib.nixvim.mkNullOrOption types.str ''
DEPRECATED, please use `desc`.
'';
desc = helpers.mkNullOrOption types.str ''
desc = lib.nixvim.mkNullOrOption types.str ''
A textual description of this autocommand.
'';
callback = helpers.mkNullOrOption (with types; either str rawLua) ''
callback = lib.nixvim.mkNullOrOption (with types; either str rawLua) ''
A function or a string.
- if a string, the name of a Vimscript function to call when this autocommand is triggered.
- Otherwise, a Lua function which is called when this autocommand is triggered.
@ -65,13 +66,13 @@ rec {
}
'';
command = helpers.defaultNullOpts.mkStr "" ''
command = defaultNullOpts.mkStr "" ''
Vim command to execute on event. Cannot be used with `callback`.
'';
once = helpers.defaultNullOpts.mkBool false "Run the autocommand only once.";
once = defaultNullOpts.mkBool false "Run the autocommand only once.";
nested = helpers.defaultNullOpts.mkBool false "Run nested autocommands.";
nested = defaultNullOpts.mkBool false "Run nested autocommands.";
};
autoCmdOption = types.submodule { options = autoCmdOptions; };