diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2024-04-21 11:53:36 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2024-04-21 11:53:36 -0400 |
commit | a202d2a2a3904006d33076ebae9a99810dae87da (patch) | |
tree | 8d674a5d667a9feca9cf1e2121d624e895cb6d7b /src/lpm.lua | |
parent | d29296812a8383cb15dcc517347803eadf073a9c (diff) | |
download | lite-xl-plugin-manager-a202d2a2a3904006d33076ebae9a99810dae87da.tar.gz lite-xl-plugin-manager-a202d2a2a3904006d33076ebae9a99810dae87da.zip |
Made {{ a thing.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r-- | src/lpm.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index 457fa06..e39d1a9 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -2447,8 +2447,9 @@ not commonly used publically. if arg:sub(offset, offset) == "{" then s,e = arg:find("%b{}", offset) if not e then error(string.format("no end to chunk %s", arg:sub(offset))) end - local chunk = arg:sub(s + 1, e - 1) - local func, err = load("local addon = ... return " .. chunk) + local amount = arg:sub(offset+1, offset+1) == "{" and 2 or 1 + local chunk = arg:sub(s + amount, e - amount) + local func, err = load("local addon = ... " .. (amount == 2 and "return" or "") .. " " .. chunk) if err then error(string.format("can't parse chunk %s: %s", chunk, err)) end result[i] = func offset = e + 1 |