mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-09 14:45:58 +01:00
lz.n: generate less code
This commit is contained in:
parent
e086dc02fe
commit
c7df5c97f3
1 changed files with 15 additions and 9 deletions
|
@ -40,15 +40,21 @@
|
|||
end
|
||||
''
|
||||
else null;
|
||||
after = mkLuaInline ''
|
||||
function()
|
||||
${
|
||||
optionalString (spec.setupModule != null)
|
||||
"require(${toJSON spec.setupModule}).setup(${toLuaObject spec.setupOpts})"
|
||||
}
|
||||
${optionalString (spec.after != null) spec.after}
|
||||
end
|
||||
'';
|
||||
|
||||
after =
|
||||
if spec.setupModule == null && spec.after == null
|
||||
then null
|
||||
else
|
||||
mkLuaInline ''
|
||||
function()
|
||||
${
|
||||
optionalString (spec.setupModule != null)
|
||||
"require(${toJSON spec.setupModule}).setup(${toLuaObject spec.setupOpts})"
|
||||
}
|
||||
${optionalString (spec.after != null) spec.after}
|
||||
end
|
||||
'';
|
||||
|
||||
keys =
|
||||
if typeOf spec.keys == "list" && length spec.keys > 0 && typeOf (head spec.keys) == "set"
|
||||
then map toLuzLznKeySpec spec.keys
|
||||
|
|
Loading…
Reference in a new issue