mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
lib/utils: fix literalLua
multiline rendering
`lib.generators.toPretty` has bespoke handling for rendering nix strings using either the `" "` or `'' ''` syntax, based on some heuristics. Using `toPretty` instead of `toJSON` improves how literal-lua examples render in the docs.
This commit is contained in:
parent
62ecd39b40
commit
e6e5369535
1 changed files with 1 additions and 1 deletions
|
@ -169,7 +169,7 @@ rec {
|
|||
# Pass the value through mkRaw for validation
|
||||
raw = mkRaw r;
|
||||
# TODO: consider switching to lib.generators.mkLuaInline ?
|
||||
exp = "lib.nixvim.mkRaw " + builtins.toJSON raw.__raw;
|
||||
exp = "lib.nixvim.mkRaw " + lib.generators.toPretty { } raw.__raw;
|
||||
in
|
||||
lib.literalExpression exp;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue