mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
helpers/toLuaObject: add support for raw keys
This commit is contained in:
parent
29922e13f7
commit
03c5f5eb74
1 changed files with 9 additions and 4 deletions
|
@ -15,12 +15,17 @@ rec {
|
||||||
+ (concatStringsSep "," (
|
+ (concatStringsSep "," (
|
||||||
mapAttrsToList (
|
mapAttrsToList (
|
||||||
n: v:
|
n: v:
|
||||||
if (builtins.match "__unkeyed.*" n) != null then
|
let
|
||||||
toLuaObject v
|
valueString = toLuaObject v;
|
||||||
|
in
|
||||||
|
if hasPrefix "__unkeyed" n then
|
||||||
|
valueString
|
||||||
|
else if hasPrefix "__rawKey__" n then
|
||||||
|
"[${n}] = " + valueString
|
||||||
else if n == "__emptyString" then
|
else if n == "__emptyString" then
|
||||||
"[''] = " + (toLuaObject v)
|
"[''] = " + valueString
|
||||||
else
|
else
|
||||||
"[${toLuaObject n}] = " + (toLuaObject v)
|
"[${toLuaObject n}] = " + valueString
|
||||||
) (filterAttrs (n: v: v != null && (toLuaObject v != "{}")) args)
|
) (filterAttrs (n: v: v != null && (toLuaObject v != "{}")) args)
|
||||||
))
|
))
|
||||||
+ "}"
|
+ "}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue