mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +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 "," (
|
||||
mapAttrsToList (
|
||||
n: v:
|
||||
if (builtins.match "__unkeyed.*" n) != null then
|
||||
toLuaObject v
|
||||
let
|
||||
valueString = toLuaObject v;
|
||||
in
|
||||
if hasPrefix "__unkeyed" n then
|
||||
valueString
|
||||
else if hasPrefix "__rawKey__" n then
|
||||
"[${n}] = " + valueString
|
||||
else if n == "__emptyString" then
|
||||
"[''] = " + (toLuaObject v)
|
||||
"[''] = " + valueString
|
||||
else
|
||||
"[${toLuaObject n}] = " + (toLuaObject v)
|
||||
"[${toLuaObject n}] = " + valueString
|
||||
) (filterAttrs (n: v: v != null && (toLuaObject v != "{}")) args)
|
||||
))
|
||||
+ "}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue