aboutsummaryrefslogtreecommitdiff
path: root/core/keys.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2011-03-17 17:41:02 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2011-03-17 17:41:02 -0400
commita1179904c022d6ccd22ebd00a4db2618a9d9ca34 (patch)
tree825bae061b80facf01a5fbf921e9120042c4211c /core/keys.lua
parent8f061a7148266ce8d4a05459f7de680a47b8899e (diff)
downloadtextadept-a1179904c022d6ccd22ebd00a4db2618a9d9ca34.tar.gz
textadept-a1179904c022d6ccd22ebd00a4db2618a9d9ca34.zip
Performance and speed improvements.
Diffstat (limited to 'core/keys.lua')
-rw-r--r--core/keys.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/keys.lua b/core/keys.lua
index 5a60b3ee..b693d523 100644
--- a/core/keys.lua
+++ b/core/keys.lua
@@ -129,7 +129,6 @@ local ALT = 'a'..ADD
-- Optimize for speed.
local string = _G.string
local string_char = string.char
-local string_format = string.format
local xpcall = _G.xpcall
local next = _G.next
local type = _G.type
@@ -168,7 +167,7 @@ local keychain = {}
-- Clears the current key sequence.
local function clear_key_sequence()
- keychain = {}
+ if #keychain > 0 then keychain = {} end
gui.statusbar_text = ''
end
@@ -234,7 +233,7 @@ local function keypress(code, shift, control, alt)
control = control and CTRL or ''
shift = shift and SHIFT or ''
alt = alt and ALT or ''
- local key_seq = string_format('%s%s%s%s', control, shift, alt, key)
+ local key_seq = control..shift..alt..key
if #keychain > 0 and key_seq == keys.clear_sequence then
clear_key_sequence()