aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/events.lua2
-rw-r--r--modules/textadept/editing.lua8
-rw-r--r--modules/textadept/run.lua4
3 files changed, 7 insertions, 7 deletions
diff --git a/core/events.lua b/core/events.lua
index 5b7c390a..ab918fa4 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -76,7 +76,7 @@ local M = {}
-- Emitted after the user types a text character into the buffer.
-- Arguments:
--
--- * _`byte`_: The text character's byte.
+-- * _`code`_: The text character's character code.
-- @field DOUBLE_CLICK (string)
-- Emitted after double-clicking the mouse button.
-- Arguments:
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 2f6062b7..06776219 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -140,9 +140,9 @@ M.autocompleters = {}
M.api_files = {}
-- Matches characters specified in char_matches.
-events.connect(events.CHAR_ADDED, function(byte)
+events.connect(events.CHAR_ADDED, function(code)
if not M.AUTOPAIR then return end
- local match = (M.char_matches[buffer:get_lexer(true)] or M.char_matches)[byte]
+ local match = (M.char_matches[buffer:get_lexer(true)] or M.char_matches)[code]
if match and buffer.selections == 1 then buffer:insert_text(-1, match) end
end)
@@ -182,8 +182,8 @@ events.connect(events.KEYPRESS, function(code)
end)
-- Auto-indent on return.
-events.connect(events.CHAR_ADDED, function(byte)
- if not M.AUTOINDENT or byte ~= 10 then return end
+events.connect(events.CHAR_ADDED, function(code)
+ if not M.AUTOINDENT or code ~= 10 then return end
local line = buffer:line_from_position(buffer.current_pos)
local i = line - 1
while i >= 0 and buffer:get_line(i):find('^[\r\n]+$') do i = i - 1 end
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 42710813..fec77088 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -264,9 +264,9 @@ events.connect(events.BUILD_OUTPUT, print_output)
function M.stop() if M.proc then M.proc:kill() end end
-- Send line as input to process stdin on return.
-events.connect(events.CHAR_ADDED, function(byte)
+events.connect(events.CHAR_ADDED, function(code)
local proc = M.proc
- if byte == 10 and proc and proc.status and proc:status() == 'running' and
+ if code == 10 and proc and proc.status and proc:status() == 'running' and
buffer._type == _L['[Message Buffer]'] then
local line_num = buffer:line_from_position(buffer.current_pos) - 1
proc:write((buffer:get_line(line_num)))