aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/command_entry.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua
index c3dfd963..c4ab7b7a 100644
--- a/modules/textadept/command_entry.lua
+++ b/modules/textadept/command_entry.lua
@@ -52,7 +52,7 @@ module('gui.command_entry')]]
-- @name enter_mode
function M.enter_mode(mode)
keys.MODE = mode
- if mode then keys[mode]['esc'] = M.enter_mode end
+ if mode and not keys[mode]['esc'] then keys[mode]['esc'] = M.enter_mode end
-- In curses, M.focus() does not return immediately, so the key sequence that
-- called M.focus() is still on the keychain. Clear it.
if CURSES then keys.clear_key_sequence() end