diff options
author | 2010-12-26 19:43:49 -0500 | |
---|---|---|
committer | 2010-12-26 19:43:49 -0500 | |
commit | 034d3e7335cb8991333fe9a2edb99509689ebcfa (patch) | |
tree | 1bfddee1ce87622cd1af2c5e52d03a4b1d236650 /modules/textadept/editing.lua | |
parent | eaf639a59643ee3e84a573c2c3d95c78326fd41c (diff) | |
download | textadept-034d3e7335cb8991333fe9a2edb99509689ebcfa.tar.gz textadept-034d3e7335cb8991333fe9a2edb99509689ebcfa.zip |
Separated key command manager from key command definitions.
Diffstat (limited to 'modules/textadept/editing.lua')
-rw-r--r-- | modules/textadept/editing.lua | 5 |
1 files changed, 3 insertions, 2 deletions
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 |