plugins/utils: normalize plugin defaults

This commit is contained in:
Matt Sturgeon 2024-06-11 16:54:57 +01:00
parent b10a391bd0
commit 6ab2a39e6a
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
53 changed files with 1434 additions and 1221 deletions

View file

@ -31,16 +31,14 @@ in
executionMessage = {
message =
helpers.defaultNullOpts.mkNullable (with types; either str helpers.nixvimTypes.rawLua)
''
{
__raw = \'\'
function()
return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"))
end
\'\';
}
''
helpers.defaultNullOpts.mkStr
{
__raw = ''
function()
return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"))
end
'';
}
''
The message to print en save.
This can be a lua function that returns a string.
@ -48,7 +46,7 @@ in
dim = helpers.defaultNullOpts.mkNullable (types.numbers.between 0
1
) "0.18" "Dim the color of `message`.";
) 0.18 "Dim the color of `message`.";
cleaningInterval = helpers.defaultNullOpts.mkInt 1250 ''
Time (in milliseconds) to wait before automatically cleaning MsgArea after displaying
@ -58,7 +56,11 @@ in
};
triggerEvents =
helpers.defaultNullOpts.mkNullable (with types; listOf str) ''["InsertLeave" "TextChanged"]''
helpers.defaultNullOpts.mkListOf types.str
[
"InsertLeave"
"TextChanged"
]
''
Vim events that trigger auto-save.
See `:h events`.