aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/args.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2010-06-18 16:57:05 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2010-06-18 16:57:05 -0400
commit4d811a578baaae01c1aad34d9f3c176c40831841 (patch)
tree52e6aeb9d568224d87809b528be4d4872718ac1f /core/args.lua
parent44d46d022675756783e3c007923a77446d52b7e7 (diff)
Fixed bug with args and sessions.
Diffstat (limited to 'core/args.lua')
-rw-r--r--core/args.lua10
1 files changed, 4 insertions, 6 deletions
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