aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2007-12-02 22:41:15 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2007-12-02 22:41:15 -0500
commit9dfc3300fc94b8d346cfbaa36d5f289a2c169beb (patch)
treeff06d8b9bd3688080ba1e04f16e8331890ffe1f1
parentc36e871f924debae148d342464e93cef585969ca (diff)
downloadtextadept-9dfc3300fc94b8d346cfbaa36d5f289a2c169beb.tar.gz
textadept-9dfc3300fc94b8d346cfbaa36d5f289a2c169beb.zip
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.
-rw-r--r--init.lua7
1 files changed, 6 insertions, 1 deletions
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()