Rebased, and added the ability for ctrl to just create new cursors.
This commit is contained in:
parent
292c98935c
commit
704e04396f
|
@ -384,7 +384,7 @@ local commands = {
|
||||||
end
|
end
|
||||||
os.remove(filename)
|
os.remove(filename)
|
||||||
core.log("Removed \"%s\"", filename)
|
core.log("Removed \"%s\"", filename)
|
||||||
end
|
end,
|
||||||
|
|
||||||
["doc:create-cursor-previous-line"] = function()
|
["doc:create-cursor-previous-line"] = function()
|
||||||
split_cursor(-1)
|
split_cursor(-1)
|
||||||
|
@ -394,7 +394,7 @@ local commands = {
|
||||||
["doc:create-cursor-next-line"] = function()
|
["doc:create-cursor-next-line"] = function()
|
||||||
split_cursor(1)
|
split_cursor(1)
|
||||||
doc():merge_cursors()
|
doc():merge_cursors()
|
||||||
end,
|
end
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -256,7 +256,11 @@ function DocView:on_mouse_pressed(button, x, y, clicks)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local line, col = self:resolve_screen_position(x, y)
|
local line, col = self:resolve_screen_position(x, y)
|
||||||
|
if keymap.modkeys["ctrl"] then
|
||||||
|
self.doc:add_selection(mouse_selection(self.doc, clicks, line, col, line, col))
|
||||||
|
else
|
||||||
self.doc:set_selection(mouse_selection(self.doc, clicks, line, col, line, col))
|
self.doc:set_selection(mouse_selection(self.doc, clicks, line, col, line, col))
|
||||||
|
end
|
||||||
self.mouse_selecting = { line, col, clicks = clicks }
|
self.mouse_selecting = { line, col, clicks = clicks }
|
||||||
end
|
end
|
||||||
core.blink_reset()
|
core.blink_reset()
|
||||||
|
|
Loading…
Reference in New Issue