aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/keys.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-03-16 16:11:57 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-03-16 16:11:57 -0400
commit02b7d6e35fd12be808814f9dec29f897c9911539 (patch)
tree0129fd1292d4e6ff528804521ba6eed0148c995f /core/keys.lua
parentc8e73a92164fa17597985dd4f2d63ec2d91badd8 (diff)
Renamed `keys.MODE` to `keys.mode`.
Diffstat (limited to 'core/keys.lua')
-rw-r--r--core/keys.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/keys.lua b/core/keys.lua
index 2d5a1033..d115d2e4 100644
--- a/core/keys.lua
+++ b/core/keys.lua
@@ -64,7 +64,7 @@ local M = {}
--
-- ## Modes
--
--- Modes are groups of key bindings such that when a key [mode](#keys.MODE) is
+-- Modes are groups of key bindings such that when a key [mode](#keys.mode) is
-- active, Textadept ignores all key bindings defined outside the mode until the
-- mode is unset. Here is a simple vi mode example:
--
@@ -74,16 +74,16 @@ local M = {}
-- ['k'] = buffer.line_down,
-- ['l'] = buffer.char_right,
-- ['i'] = function()
--- keys.MODE = nil
+-- keys.mode = nil
-- ui.statusbar_text = 'INSERT MODE'
-- end
-- }
--- keys['esc'] = function() keys.MODE = 'command_mode' end
+-- keys['esc'] = function() keys.mode = 'command_mode' end
-- events.connect(events.UPDATE_UI, function()
--- if keys.MODE == 'command_mode' then return end
+-- if keys.mode == 'command_mode' then return end
-- ui.statusbar_text = 'INSERT MODE'
-- end)
--- keys.MODE = 'command_mode' -- default mode
+-- keys.mode = 'command_mode' -- default mode
--
-- ## Key Chains
--
@@ -101,9 +101,9 @@ local M = {}
-- The key that clears the current key chain.
-- It cannot be part of a key chain.
-- The default value is `'esc'` for the `Esc` key.
--- @field MODE (string)
+-- @field mode (string)
-- The current key mode.
--- When non-`nil`, all key bindings defined outside of `keys[MODE]` are
+-- When non-`nil`, all key bindings defined outside of `keys[mode]` are
-- ignored.
-- The default value is `nil`.
module('keys')]]
@@ -220,11 +220,11 @@ local function keypress(code, shift, control, alt, meta, caps_lock)
keychain[#keychain + 1] = key_seq
local status = PROPAGATE
- if not M.MODE then
+ if not M.mode then
status = key_command(buffer:get_lexer(true))
- if status <= PROPAGATE and not M.MODE then status = key_command() end
+ if status <= PROPAGATE and not M.mode then status = key_command() end
else
- status = key_command(M.MODE)
+ status = key_command(M.mode)
end
if status ~= CHAIN then clear_key_sequence() end
if status > PROPAGATE then return true end -- CHAIN or HALT