made stringx.deindent remove all trailing empties rather than just one

This commit is contained in:
Max Cahill 2022-07-11 16:44:51 +10:00
parent 9f5dfcb923
commit 24fde1c157

View File

@ -206,9 +206,9 @@ function stringx.deindent(s, keep_trailing_empty)
table.insert(res, line) table.insert(res, line)
end end
--should --should we keep any trailing empty lines?
if not keep_trailing_empty then if not keep_trailing_empty then
if res[#res] == "" then while res[#res] == "" do
table.remove(res) table.remove(res)
end end
end end