aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
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.