From 034d3e7335cb8991333fe9a2edb99509689ebcfa Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 26 Dec 2010 19:43:49 -0500 Subject: Separated key command manager from key command definitions. --- modules/textadept/editing.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/textadept/editing.lua') diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index fd618c9f..6a0f7cca 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -2,6 +2,7 @@ local L = _G.locale.localize local events = _G.events +local K = keys.KEYSYMS --- -- Editing commands for the textadept module. @@ -85,7 +86,7 @@ events.connect('char_added', events.connect('keypress', function(code, shift, control, alt) -- removes matched chars on backspace - if not AUTOPAIR or code ~= 0xff08 or buffer.selections ~= 1 then return end + if not AUTOPAIR or K[code] ~= '\b' or buffer.selections ~= 1 then return end local buffer = buffer local current_pos = buffer.current_pos local c = buffer.char_at[current_pos - 1] @@ -441,7 +442,7 @@ local function clear_highlighted_words() buffer:indicator_clear_range(0, buffer.length) end events.connect('keypress', - function(c) if c == 0xff1b then clear_highlighted_words() end end) -- Esc + function(c) if K[c] == 'esc' then clear_highlighted_words() end end) --- -- Highlights all occurances of the word under the caret and adds markers to the -- cgit v1.2.3