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
View File
@@ -278,6 +278,7 @@ function DocView:on_mouse_moved(x, y, ...)
local clicks = self.mouse_selecting.clicks
if keymap.modkeys["ctrl"] then
if l1 > l2 then l1, l2 = l2, l1 end
self.doc.selections = { }
for i = l1, l2 do
self.doc:set_selections(i - l1 + 1, i, math.min(c1, #self.doc.lines[i]), i, math.min(c2, #self.doc.lines[i]))
end