On doc:newline remove line content if it contains only whitespace

This commit is contained in:
Guldoman
2022-06-25 03:57:47 +02:00
parent 438ed6984a
commit c792b13666
+4
View File
@@ -233,6 +233,10 @@ local commands = {
if col <= #indent then if col <= #indent then
indent = indent:sub(#indent + 2 - col) indent = indent:sub(#indent + 2 - col)
end end
-- Remove current line if it contains only whitespace
if doc().lines[line]:match("^%s+$") then
doc():remove(line, 1, line, math.huge)
end
doc():text_input("\n" .. indent, idx) doc():text_input("\n" .. indent, idx)
end end
end, end,