diff options
author | 2015-04-22 23:53:02 -0400 | |
---|---|---|
committer | 2015-04-22 23:53:02 -0400 | |
commit | 17ebad90a7877aae5e658769f906d4cf5bc659d3 (patch) | |
tree | 6a9c673e03aea56eac3954c15ab333ee224ec881 /modules | |
parent | 482bb6fe0c844c1e82132369b50e0bbe6270221e (diff) | |
download | textadept-17ebad90a7877aae5e658769f906d4cf5bc659d3.tar.gz textadept-17ebad90a7877aae5e658769f906d4cf5bc659d3.zip |
Added `RUN_IN_BACKGROUND` field for shell commands; modules/textadept/run.lua
Diffstat (limited to 'modules')
-rw-r--r-- | modules/textadept/run.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index 6a20755b..95e57b26 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -8,6 +8,11 @@ local M = {} -- [Language modules](#_M.Compile.and.Run) may tweak the `compile_commands`, -- `run_commands`, and/or `error_patterns` tables for particular languages. -- The user may tweak `build_commands` for particular projects. +-- @field RUN_IN_BACKGROUND (bool) +-- Run shell commands silently in the background. +-- This only applies when the message buffer is open, though it does not have +-- to be visible. +-- The default value is `false`. -- @field MARK_WARNING (number) -- The run or compile warning marker number. -- @field MARK_ERROR (number) @@ -44,6 +49,8 @@ local M = {} -- * `output`: A line of string output from the command. module('textadept.run')]] +M.RUN_IN_BACKGROUND = false + M.MARK_WARNING = _SCINTILLA.next_marker_number() M.MARK_ERROR = _SCINTILLA.next_marker_number() @@ -112,7 +119,7 @@ local function run_command(commands, event) local function emit_status(status) emit_output('> exit status: '..status) end if commands == M.build_commands then emit_output('> cd '..cwd) end - emit_output('> '..command, true) + emit_output('> '..command, not M.RUN_IN_BACKGROUND) local p, err = spawn(command, cwd, emit_output, emit_output, emit_status) if not p then error(err) end |