Introduced the constraint that all cursors must be in order.

This commit is contained in:
Adam Harrison
2021-06-18 17:33:55 -04:00
parent b065b52067
commit 6915d86d59
3 changed files with 55 additions and 40 deletions
+1 -2
View File
@@ -110,7 +110,7 @@ local commands = {
end,
["doc:newline"] = function()
for idx, line, col in doc():get_selections() do
for idx, line, col in doc():get_selections(false, true) do
local indent = doc().lines[line]:match("^[\t ]*")
if col <= #indent then
indent = indent:sub(#indent + 2 - col)
@@ -208,7 +208,6 @@ local commands = {
["doc:indent"] = function()
for idx, line1, col1, line2, col2 in doc_multiline_selections(true) do
print("LINE", line1, col1, line2, col2)
local l1, c1, l2, c2 = doc():indent_text(false, line1, col1, line2, col2)
if l1 then
doc():set_selections(idx, l1, c1, l2, c2)