diff options
author | 2018-10-14 19:50:17 -0400 | |
---|---|---|
committer | 2018-10-14 19:50:17 -0400 | |
commit | 5e86b286cf366e0db1a361d36dba4dac6d6dd843 (patch) | |
tree | 94a27c66408588e218e965e5ec55528f2671f372 /modules/textadept | |
parent | fca69ee9e7b7593005d6692911dfa2d081759762 (diff) | |
download | textadept-5e86b286cf366e0db1a361d36dba4dac6d6dd843.tar.gz textadept-5e86b286cf366e0db1a361d36dba4dac6d6dd843.zip |
Experimentally move external lspawn module into Lua os module as a patch.
Diffstat (limited to 'modules/textadept')
-rw-r--r-- | modules/textadept/editing.lua | 2 | ||||
-rw-r--r-- | modules/textadept/menu.lua | 2 | ||||
-rw-r--r-- | modules/textadept/run.lua | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index b8d7e341..cf449234 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -599,7 +599,7 @@ function M.filter_through(command) }), command) local output = buffer.target_text for i = 1, #commands do - local p = assert(spawn(commands[i])) + local p = assert(os.spawn(commands[i])) p:write(output) p:close() output = p:read('a') or '' diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index da9703b2..f82d36f6 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -44,7 +44,7 @@ local function set_encoding(encoding) end local function open_page(url) local cmd = (WIN32 and 'start ""') or (OSX and 'open') or 'xdg-open' - spawn(string.format('%s "%s"', cmd, not OSX and url or 'file://'..url)) + os.spawn(string.format('%s "%s"', cmd, not OSX and url or 'file://'..url)) end --- diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index c81e3aa4..f8324bfe 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -158,7 +158,7 @@ local function compile_or_run(filename, commands) local event = commands == M.compile_commands and events.COMPILE_OUTPUT or events.RUN_OUTPUT local ext_or_lexer = commands[ext] and ext or lexer - local function emit_output(output) + local function emit(output) for line in output:gmatch('[^\r\n]+') do events.emit(event, line, ext_or_lexer) end @@ -167,7 +167,7 @@ local function compile_or_run(filename, commands) cwd = working_dir or dirname if cwd ~= dirname then events.emit(event, '> cd '..cwd) end events.emit(event, '> '..command:iconv('UTF-8', _CHARSET)) - proc = assert(spawn(command, cwd, emit_output, emit_output, function(status) + proc = assert(os.spawn(command, cwd, emit, emit, function(status) events.emit(event, '> exit status: '..status) end)) end @@ -283,7 +283,7 @@ function M.build(root_directory) if not command then return end -- Prepare to run the command. preferred_view = view - local function emit_output(output) + local function emit(output) for line in output:gmatch('[^\r\n]+') do events.emit(events.BUILD_OUTPUT, line) end @@ -292,7 +292,7 @@ function M.build(root_directory) cwd = working_dir or root_directory events.emit(events.BUILD_OUTPUT, '> cd '..cwd) events.emit(events.BUILD_OUTPUT, '> '..command:iconv('UTF-8', _CHARSET)) - proc = assert(spawn(command, cwd, emit_output, emit_output, function(status) + proc = assert(os.spawn(command, cwd, emit, emit, function(status) events.emit(events.BUILD_OUTPUT, '> exit status: '..status) end)) end |