aboutsummaryrefslogtreecommitdiff
path: root/core/keys.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2011-01-21 00:41:36 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2011-01-21 00:41:36 -0500
commit78bcda2db6b0b8669a6fbcf63b1143602f544416 (patch)
treedf837e91e357573ca84be0b20155189252337cec /core/keys.lua
parent2247eeb38c71da492cb96711e133b353e7c3129d (diff)
downloadtextadept-78bcda2db6b0b8669a6fbcf63b1143602f544416.tar.gz
textadept-78bcda2db6b0b8669a6fbcf63b1143602f544416.zip
Code cleanup.
Diffstat (limited to 'core/keys.lua')
-rw-r--r--core/keys.lua10
1 files changed, 3 insertions, 7 deletions
diff --git a/core/keys.lua b/core/keys.lua
index a5e47662..29a06d6d 100644
--- a/core/keys.lua
+++ b/core/keys.lua
@@ -134,7 +134,6 @@ local pcall = _G.pcall
local next = _G.next
local type = _G.type
local unpack = _G.unpack
-local OSX = _G.OSX
---
-- Lookup table for key values higher than 255.
@@ -198,12 +197,9 @@ local function run_key_command(lexer, scope)
end
local f, args = key[1], { unpack(key, 2) }
- if type(key[1]) == 'string' then
- if key[2] == 'buffer' then
- f, args = buffer[f], { buffer, unpack(key, 3) }
- elseif key[2] == 'view' then
- f, args = view[f], { view, unpack(key, 3) }
- end
+ if type(key[1]) == 'string' and (key[2] == 'buffer' or key[2] == 'view') then
+ local v = _G[key[2]]
+ f, args = v[f], { v, unpack(key, 3) }
end
if type(f) ~= 'function' then error(L('Unknown command:')..tostring(f)) end