diff options
author | 2009-10-27 15:55:58 -0400 | |
---|---|---|
committer | 2009-10-27 15:55:58 -0400 | |
commit | cc9028fbf9b082252615595dae5580c7cb38c952 (patch) | |
tree | 59957440d451e3fd61a9d824d20d91e8ddde8b79 /modules/textadept/run.lua | |
parent | bf39948dac59eca478e853f1173d02d408e48520 (diff) | |
download | textadept-cc9028fbf9b082252615595dae5580c7cb38c952.tar.gz textadept-cc9028fbf9b082252615595dae5580c7cb38c952.zip |
Fixed bug for running filename with no path; modules/textadept/run.lua
Diffstat (limited to 'modules/textadept/run.lua')
-rw-r--r-- | modules/textadept/run.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index fcdb6a43..2b334fd1 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -17,7 +17,12 @@ module('_m.textadept.run', package.seeall) -- * %(filename_noext) The name of the file excluding extension. function execute(command) local filepath = textadept.iconv(buffer.filename, _CHARSET, 'UTF-8') - local filedir, filename = filepath:match('^(.+[/\\])([^/\\]+)$') + local filedir, filename + if filepath:find('[/\\]') then + filedir, filename = filepath:match('^(.+[/\\])([^/\\]+)$') + else + filedir, filename = '', filepath + end local filename_noext = filename:match('^(.+)%.') command = command:gsub('%%%b()', { ['%(filepath)'] = filepath, |