From 4d811a578baaae01c1aad34d9f3c176c40831841 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Fri, 18 Jun 2010 16:57:05 -0400 Subject: Fixed bug with args and sessions. --- core/args.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'core') diff --git a/core/args.lua b/core/args.lua index 28ecfd4a..8599afe8 100644 --- a/core/args.lua +++ b/core/args.lua @@ -29,10 +29,7 @@ end -- Generates an 'arg_none' event when no args are present. -- @see register function process() - if #arg == 0 then - events.emit('arg_none') - return - end + local no_args = true local i = 1 while i <= #arg do local switch = switches[arg[i]] @@ -44,9 +41,11 @@ function process() i = i + n else io.open_file(arg[i]) + no_args = false end i = i + 1 end + if no_args then events.emit('arg_none') end end local function show_help() @@ -80,8 +79,7 @@ if MAC and arg[1] and arg[1]:find('^%-psn_0') then table.remove(arg, 1) end local userhome = os.getenv(not WIN32 and 'HOME' or 'USERPROFILE')..'/.textadept' for i = 1, #arg do if (arg[i] == '-u' or arg[i] == '--userhome') and arg[i + 1] then - userhome = table.remove(arg, i + 1) - table.remove(arg, i) + userhome = arg[i + 1] break end end -- cgit v1.2.3