Added command doc:select-none, added binding to escape

This commit is contained in:
rxi 2020-05-01 19:25:17 +01:00
parent 885ed5f860
commit 4ca35fe056
2 changed files with 6 additions and 1 deletions

View file

@ -135,6 +135,11 @@ local commands = {
doc():set_selection(1, 1, math.huge, math.huge) doc():set_selection(1, 1, math.huge, math.huge)
end, end,
["doc:select-none"] = function()
local line, col = doc():get_selection()
doc():set_selection(line, col)
end,
["doc:select-lines"] = function() ["doc:select-lines"] = function()
local line1, _, line2, _, swap = doc():get_selection(true) local line1, _, line2, _, swap = doc():get_selection(true)
append_line_if_last_line(line2) append_line_if_last_line(line2)

View file

@ -127,7 +127,7 @@ keymap.add {
["ctrl+x"] = "doc:cut", ["ctrl+x"] = "doc:cut",
["ctrl+c"] = "doc:copy", ["ctrl+c"] = "doc:copy",
["ctrl+v"] = "doc:paste", ["ctrl+v"] = "doc:paste",
["escape"] = { "command:escape" }, ["escape"] = { "command:escape", "doc:select-none" },
["tab"] = { "command:complete", "doc:indent" }, ["tab"] = { "command:complete", "doc:indent" },
["shift+tab"] = "doc:unindent", ["shift+tab"] = "doc:unindent",
["backspace"] = "doc:backspace", ["backspace"] = "doc:backspace",