aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/keys.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-02-26 11:17:46 -0500
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-02-26 11:17:46 -0500
commit0e07b7478899600805c32564f1b88c1aaedbe16f (patch)
tree0a0db93a3ba009e06e0cafc700b78cd65fba3e24 /core/keys.lua
parenta291022fbd9dbc749508917dfa10f40ad0323436 (diff)
Small code cleanup.
Diffstat (limited to 'core/keys.lua')
-rw-r--r--core/keys.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/keys.lua b/core/keys.lua
index 74d52ff9..35af9bc8 100644
--- a/core/keys.lua
+++ b/core/keys.lua
@@ -152,13 +152,13 @@ local keychain = {}
-- @name keychain
M.keychain = setmetatable({}, {
__index = keychain,
- __newindex = function() error("read-only table") end,
+ __newindex = function() error('read-only table') end,
__len = function() return #keychain end
})
-- Clears the current key sequence.
+-- Note: clearing a table is often faster than re-creating one.
local function clear_key_sequence()
- -- Clearing a table is sometimes faster than re-creating one.
if #keychain == 1 then keychain[1] = nil else keychain = {} end
end
@@ -212,7 +212,7 @@ local function keypress(code, shift, control, alt, meta, caps_lock)
--print(key_seq)
ui.statusbar_text = ''
- --if CURSES then ui.statusbar_text = '"'..key_seq..'"' end
+ --if CURSES then ui.statusbar_text = string.format('"%s"', key_seq) end
local keychain_size = #keychain
if keychain_size > 0 and key_seq == M.CLEAR then
clear_key_sequence()