aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2014-04-22 20:27:59 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2014-04-22 20:27:59 -0400
commit892edb00db9f3118f655921c18756f7c30b179a3 (patch)
tree5a95238573f20042c2ca6addd4a859e7dda41b46 /modules
parent2e38948f4dab8d543657d4a99900281ca1c971ec (diff)
downloadtextadept-892edb00db9f3118f655921c18756f7c30b179a3.tar.gz
textadept-892edb00db9f3118f655921c18756f7c30b179a3.zip
Message buffer can send input to spawned processes; modules/textadept/run.lua
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/run.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 9a3e561b..764a994e 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -230,6 +230,16 @@ events.connect(events.BUILD_OUTPUT, print_output)
-- @name stop
function M.stop() if M.proc then M.proc:kill() end end
+-- Send line as input to process stdin on return.
+events.connect(events.CHAR_ADDED, function(char)
+ local proc = M.proc
+ if char == 10 and proc and proc.status and proc:status() == 'running' and
+ buffer._type == _L['[Message Buffer]'] then
+ local line_num = buffer:line_from_position(buffer.current_pos) - 1
+ proc:write((buffer:get_line(line_num)))
+ end
+end)
+
---
-- List of warning and error string patterns that match various compile and run
-- warnings and errors.