aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-09-17 23:16:38 -0400
committerAdam Harrison <adamdharrison@gmail.com>2023-09-17 23:16:38 -0400
commit1a54a855f9720cad10a4c47f3f65ad92d239373a (patch)
tree929234f48374f7f3774f0a753c1bbabe93ecc291 /src/lpm.lua
parentbccca54916aad5b94eed9b619b6af23b36a6aeda (diff)
downloadlite-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.lua8
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