From 9dfc3300fc94b8d346cfbaa36d5f289a2c169beb Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 2 Dec 2007 22:41:15 -0500 Subject: Fixed command line parameters bug; init.lua When files are passed by the command line, they are assumed to be relative to Textadept's path. Instead, check if the file has a leading '~/' or '/' indicating an absolute path. If so, do not treat it that way. Otherwise treat it as relative. --- init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 13a37a7d..17915db4 100644 --- a/init.lua +++ b/init.lua @@ -20,8 +20,13 @@ if #arg == 0 then textadept.io.load_session() else local base_dir = arg[0]:match('^.+/') or '' + local filepath for _, filename in ipairs(arg) do - textadept.io.open(base_dir..filename) + if not filename:match('^~?/') then + textadept.io.open(base_dir..filename) + else + textadept.io.open(filename) + end end textadept.pm.entry_text = 'buffers' textadept.pm.activate() -- cgit v1.2.3