aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/command_entry.lua
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept/command_entry.lua')
-rw-r--r--modules/textadept/command_entry.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua
index 7929a6b8..8310a8b8 100644
--- a/modules/textadept/command_entry.lua
+++ b/modules/textadept/command_entry.lua
@@ -121,7 +121,8 @@ args.register('-e', '--execute', 1, run_lua, 'Execute Lua code')
-- `ui` tables are also considered as globals.
local function complete_lua()
local line, pos = M:get_cur_line()
- local symbol, op, part = line:sub(1, pos):match('([%w_.]-)([%.:]?)([%w_]*)$')
+ local symbol, op, part = line:sub(1, pos - 1):match(
+ '([%w_.]-)([%.:]?)([%w_]*)$')
local ok, result = pcall(
(load(string.format('return (%s)', symbol), nil, 't', env)))
if (not ok or type(result) ~= 'table') and symbol ~= '' then return end