Moved commands out to the outer event loop.

This commit is contained in:
Adam Harrison
2021-11-14 15:41:28 -05:00
parent 6f53ee1b69
commit ce2ec9f442
6 changed files with 21 additions and 7 deletions
+6
View File
@@ -389,6 +389,12 @@ local commands = {
core.log("Removed \"%s\"", filename)
end,
["doc:select-to-cursor"] = function(x, y, clicks)
local line1, col1 = select(3, doc():get_selection())
local line2, col2 = dv():resolve_screen_position(x, y)
doc():set_selection(line2, col2, line1, col1)
end,
["doc:set-cursor"] = function(x, y, clicks)
local line, col = dv():resolve_screen_position(x, y)
doc():set_selection(line, col, line, col)