diff options
author | 2019-11-26 10:21:44 -0500 | |
---|---|---|
committer | 2019-11-26 10:21:44 -0500 | |
commit | a84a9d17125beaec5f61329c6dd77aa54d21046e (patch) | |
tree | 9a5fca1e4747938af35ca15c31273e97f35bb6c1 /modules/textadept | |
parent | 7c4e847280cbc6459c9ee9fe22830a7532063f1a (diff) | |
download | textadept-a84a9d17125beaec5f61329c6dd77aa54d21046e.tar.gz textadept-a84a9d17125beaec5f61329c6dd77aa54d21046e.zip |
Fixed bug in previous commit where flushing does not clear output buffer.
Diffstat (limited to 'modules/textadept')
-rw-r--r-- | modules/textadept/run.lua | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index 622977e6..de07b766 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -136,17 +136,18 @@ local output_buffer -- executed command. This is used for better error detection in compile and -- run commands. local function print_output(output, ext_or_lexer) - if not output then - if output_buffer then print_line(output_buffer, ext_or_lexer) end - return - end - if output_buffer then output = output_buffer..output end - local remainder = 1 - for line, e in output:gmatch('([^\r\n]*)\r?\n()') do - print_line(line, ext_or_lexer) - remainder = e + if output then + if output_buffer then output = output_buffer..output end + local remainder = 1 + for line, e in output:gmatch('([^\r\n]*)\r?\n()') do + print_line(line, ext_or_lexer) + remainder = e + end + output_buffer = remainder <= #output and string.sub(output, remainder) + elseif output_buffer then + print_line(output_buffer, ext_or_lexer) + output_buffer = nil end - output_buffer = remainder <= #output and string.sub(output, remainder) end -- Compiles or runs file *filename* based on a shell command in *commands*. |