mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
lib/types: allow inline-lua in rawLua
type
This commit is contained in:
parent
c8267ba395
commit
587b1cbf21
1 changed files with 4 additions and 3 deletions
|
@ -14,7 +14,7 @@ let
|
||||||
name = "strLua";
|
name = "strLua";
|
||||||
inherit description;
|
inherit description;
|
||||||
descriptionClass = "noun";
|
descriptionClass = "noun";
|
||||||
check = v: lib.isString v || isRawType v;
|
check = v: lib.isString v || types.rawLua.check v;
|
||||||
merge =
|
merge =
|
||||||
loc: defs:
|
loc: defs:
|
||||||
lib.pipe defs [
|
lib.pipe defs [
|
||||||
|
@ -24,7 +24,8 @@ let
|
||||||
(lib.options.mergeEqualOption loc)
|
(lib.options.mergeEqualOption loc)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
isRawType = v: v ? __raw && lib.isString v.__raw;
|
|
||||||
|
isRawType = v: lib.isString (v.__raw or null);
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
# TODO: deprecate in favor of types.rawLua.check
|
# TODO: deprecate in favor of types.rawLua.check
|
||||||
|
@ -36,7 +37,7 @@ rec {
|
||||||
description = "raw lua code";
|
description = "raw lua code";
|
||||||
descriptionClass = "noun";
|
descriptionClass = "noun";
|
||||||
merge = lib.options.mergeEqualOption;
|
merge = lib.options.mergeEqualOption;
|
||||||
check = v: (isRawType v) || (v ? __empty);
|
check = v: isRawType v || lib.nixvim.lua.isInline v || v ? __empty;
|
||||||
};
|
};
|
||||||
|
|
||||||
maybeRaw =
|
maybeRaw =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue