Skip to content

Commit e6e5369

Browse files
committed
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.
1 parent 62ecd39 commit e6e5369

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/utils.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ rec {
169169
# Pass the value through mkRaw for validation
170170
raw = mkRaw r;
171171
# TODO: consider switching to lib.generators.mkLuaInline ?
172-
exp = "lib.nixvim.mkRaw " + builtins.toJSON raw.__raw;
172+
exp = "lib.nixvim.mkRaw " + lib.generators.toPretty { } raw.__raw;
173173
in
174174
lib.literalExpression exp;
175175

0 commit comments

Comments
 (0)