Skip to content

Commit

Permalink
plugins/lz-n: use coercedTo in str types
Browse files Browse the repository at this point in the history
  • Loading branch information
psfloyd committed Jul 16, 2024
1 parent 03f90fa commit 8f7914b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions plugins/pluginmanagers/lz-n.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ let
description = "Lazy-load settings for ${originalName}.";
type =
with nixvimTypes;
let
nullStrToList = coercedTo str toList (listOf str);
in
submodule {
options = with defaultNullOpts; {
name = mkOption {
Expand All @@ -46,13 +49,14 @@ let
before = mkLuaFn pluginDefault.before or null "Executed before ${originalName} is loaded.";
after = mkLuaFn pluginDefault.after or null "Executed after ${originalName} is loaded.";
event =
mkNullable (listOf str) pluginDefault.event or null
"Lazy-load on event. Events can be specified as BufEnter or with a pattern like BufEnter *.lua";
cmd = mkNullable (listOf str) pluginDefault.cmd or null "Lazy-load on command.";
ft = mkNullable (listOf str) pluginDefault.ft or null "Lazy-load on filetype.";
mkNullable nullStrToList pluginDefault.event or null
"Lazy-load on event. Events can be specified as `BufEnter` or with a pattern like `BufEnter *.lua`";
cmd = mkNullable nullStrToList pluginDefault.cmd or null "Lazy-load on command.";
ft = mkNullable nullStrToList pluginDefault.ft or null "Lazy-load on filetype.";
keys = mkNullable (listOf keymaps.mapOptionSubmodule) pluginDefault.keys
or null "Lazy-load on key mapping. Use the same format as `config.keymaps`.";
colorscheme = mkNullable (listOf str) pluginDefault.colorscheme or null "Lazy-load on colorscheme.";
colorscheme = mkNullable nullStrToList pluginDefault.colorscheme
or null "Lazy-load on colorscheme.";
priority = mkNullable number pluginDefault.priority or null ''
Only useful for start plugins (not lazy-loaded) to force loading certain plugins first.
Default priority is 50 (or 1000 if colorscheme is set).
Expand Down

0 comments on commit 8f7914b

Please sign in to comment.