diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2023-09-17 23:16:38 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2023-09-17 23:16:38 -0400 |
commit | 1a54a855f9720cad10a4c47f3f65ad92d239373a (patch) | |
tree | 929234f48374f7f3774f0a753c1bbabe93ecc291 /src/lpm.lua | |
parent | bccca54916aad5b94eed9b619b6af23b36a6aeda (diff) | |
download | lite-xl-plugin-manager-1a54a855f9720cad10a4c47f3f65ad92d239373a.tar.gz lite-xl-plugin-manager-1a54a855f9720cad10a4c47f3f65ad92d239373a.zip |
Added in borders to table output.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r-- | src/lpm.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index 7a4075d..f755a33 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -1751,13 +1751,13 @@ local function get_table(headers, rows) maxes[k] = math.max(#v, maxes[k] or 0) end end local strs = {} - table.insert(strs, table.concat(common.map(headers, function(v, i) return v .. string.rep(" ", maxes[i] - #v) end), " | ")) - table.insert(strs, table.concat(common.map(headers, function(v, i) return string.rep("-", maxes[i]) end), " | ")) + table.insert(strs, "| " .. table.concat(common.map(headers, function(v, i) return v .. string.rep(" ", maxes[i] - #v) end), " | ") .. " |") + table.insert(strs, "| " .. table.concat(common.map(headers, function(v, i) return string.rep("-", maxes[i]) end), " | ") .. " |") for i,row in ipairs(rows) do - table.insert(strs, table.concat(common.map(row, function(v, i) + table.insert(strs, "| " .. table.concat(common.map(row, function(v, i) if type(v) == "table" then v = table.concat(v, ", ") else v = tostring(v) end return v .. string.rep(" ", maxes[i] - #v) - end), " | ")) + end), " | ") .. " |") end return table.concat(strs, "\n") end |