plugins/ui: normalize plugin defaults

This commit is contained in:
Matt Sturgeon 2024-06-11 16:54:41 +01:00
parent d7b0cf8014
commit b10a391bd0
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
8 changed files with 288 additions and 243 deletions

View file

@ -21,7 +21,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
benefit from the performance optimizations in this plugin.
'';
thousands = helpers.defaultNullOpts.mkNullable (with types; either str (enum [ false ])) "false" ''
thousands = helpers.defaultNullOpts.mkNullable (with types; either str (enum [ false ])) false ''
`false` or line number thousands separator string ("." / ",").
'';
@ -62,15 +62,15 @@ helpers.neovim-plugin.mkNeovimPlugin config {
) "Table of booleans or functions returning a boolean.";
sign = {
name = helpers.defaultNullOpts.mkListOf types.str "[]" ''
name = helpers.defaultNullOpts.mkListOf types.str [ ] ''
List of lua patterns to match the sign name against.
'';
text = helpers.defaultNullOpts.mkListOf types.str "[]" ''
text = helpers.defaultNullOpts.mkListOf types.str [ ] ''
List of lua patterns to match the extmark sign text against.
'';
namespace = helpers.defaultNullOpts.mkListOf types.str "[]" ''
namespace = helpers.defaultNullOpts.mkListOf types.str [ ] ''
List of lua patterns to match the extmark sign namespace against.
'';
@ -98,29 +98,27 @@ helpers.neovim-plugin.mkNeovimPlugin config {
};
};
in
helpers.defaultNullOpts.mkListOf segmentType ''
[
{
text = ["%C"];
click = "v:lua.ScFa";
}
{
text = ["%s"];
click = "v:lua.ScSa";
}
{
text = [
{__raw = "require('statuscol.builtin').lnumfunc";}
" "
];
condition = [
true
{__raw = "require('statuscol.builtin').not_empty";}
];
click = "v:lua.ScLa";
}
]
'' "The statuscolumn can be customized through the `segments` option.";
helpers.defaultNullOpts.mkListOf segmentType [
{
text = [ "%C" ];
click = "v:lua.ScFa";
}
{
text = [ "%s" ];
click = "v:lua.ScSa";
}
{
text = [
{ __raw = "require('statuscol.builtin').lnumfunc"; }
" "
];
condition = [
true
{ __raw = "require('statuscol.builtin').not_empty"; }
];
click = "v:lua.ScLa";
}
] "The statuscolumn can be customized through the `segments` option.";
clickmod = helpers.defaultNullOpts.mkStr "c" ''
Modifier used for certain actions in the builtin clickhandlers: