diff options
author | 2007-12-02 22:41:15 -0500 | |
---|---|---|
committer | 2007-12-02 22:41:15 -0500 | |
commit | 9dfc3300fc94b8d346cfbaa36d5f289a2c169beb (patch) | |
tree | ff06d8b9bd3688080ba1e04f16e8331890ffe1f1 | |
parent | c36e871f924debae148d342464e93cef585969ca (diff) | |
download | textadept-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.lua | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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() |