From 4ca35fe0566a736f964b6696ebc677521b134198 Mon Sep 17 00:00:00 2001 From: rxi Date: Fri, 1 May 2020 19:25:17 +0100 Subject: [PATCH] Added command `doc:select-none`, added binding to `escape` --- data/core/commands/doc.lua | 5 +++++ data/core/keymap.lua | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/data/core/commands/doc.lua b/data/core/commands/doc.lua index c62f92c7..90c0675a 100644 --- a/data/core/commands/doc.lua +++ b/data/core/commands/doc.lua @@ -135,6 +135,11 @@ local commands = { doc():set_selection(1, 1, math.huge, math.huge) end, + ["doc:select-none"] = function() + local line, col = doc():get_selection() + doc():set_selection(line, col) + end, + ["doc:select-lines"] = function() local line1, _, line2, _, swap = doc():get_selection(true) append_line_if_last_line(line2) diff --git a/data/core/keymap.lua b/data/core/keymap.lua index e3ec74c5..24540f1d 100644 --- a/data/core/keymap.lua +++ b/data/core/keymap.lua @@ -127,7 +127,7 @@ keymap.add { ["ctrl+x"] = "doc:cut", ["ctrl+c"] = "doc:copy", ["ctrl+v"] = "doc:paste", - ["escape"] = { "command:escape" }, + ["escape"] = { "command:escape", "doc:select-none" }, ["tab"] = { "command:complete", "doc:indent" }, ["shift+tab"] = "doc:unindent", ["backspace"] = "doc:backspace",