diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/args.lua | 6 | ||||
-rw-r--r-- | core/events.lua | 6 | ||||
-rw-r--r-- | core/keys.lua | 5 |
3 files changed, 9 insertions, 8 deletions
diff --git a/core/args.lua b/core/args.lua index ea1c9093..6a65bde5 100644 --- a/core/args.lua +++ b/core/args.lua @@ -41,10 +41,10 @@ function process() while i <= #arg do local switch = switches[arg[i]] if switch then - local f, n = unpack(switch) + local f, n = table.unpack(switch) local args = {} for j = i + 1, i + n do args[#args + 1] = arg[j] end - f(unpack(args)) + f(table.unpack(args)) i = i + n else io.open_file(arg[i]) @@ -59,7 +59,7 @@ end local function show_help() print('Usage: textadept [args] [filenames]') local line = " %s [%d args]: %s" - for k, v in pairs(switches) do print(line:format(k, unpack(v, 2))) end + for k, v in pairs(switches) do print(line:format(k, table.unpack(v, 2))) end os.exit() end register('-h', '--help', 0, show_help, 'Displays this') diff --git a/core/events.lua b/core/events.lua index 2145bee4..d6a7b270 100644 --- a/core/events.lua +++ b/core/events.lua @@ -226,9 +226,9 @@ function emit(event, ...) if not event then error(L('Undefined event name')) end local h = handlers[event] if not h then return end - local pcall, unpack, type = pcall, unpack, type + local pcall, table_unpack, type = pcall, table.unpack, type for i = 1, #h do - local ok, result = pcall(h[i], unpack{...}) + local ok, result = pcall(h[i], table_unpack{...}) if not ok then if not error_emitted then error_emitted = true @@ -276,7 +276,7 @@ connect('SCN', function(n) if not f then return end local args = {} for i = 2, #f do args[i - 1] = n[f[i]] end - return emit(f[1], unpack(args)) + return emit(f[1], table.unpack(args)) end) -- Set event constants. diff --git a/core/keys.lua b/core/keys.lua index 4d1ccf48..61d8ba55 100644 --- a/core/keys.lua +++ b/core/keys.lua @@ -107,7 +107,8 @@ LANGUAGE_MODULE_PREFIX = (not OSX and CTRL or META)..'l' local OSX = OSX local string = string local string_byte, string_char = string.byte, string.char -local xpcall, next, type, unpack = xpcall, next, type, unpack +local table_unpack = table.unpack +local xpcall, next, type = xpcall, next, type local no_args = {} local getmetatable = getmetatable local error = function(e) events.emit(events.ERROR, e) end @@ -164,7 +165,7 @@ local function run_command(command, command_type) end end end - local _, result = xpcall(function() return f(unpack(args, 2)) end, error) + local _, result = xpcall(f, error, table_unpack(args, 2)) return result end _M.run_command = run_command -- export for menu.lua without creating LuaDoc |