From d4df6904a70b4b90f896ec8812a19368d2e04bdd Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 17 Oct 2018 14:52:45 -0400 Subject: When filtering text through shell commands, halt on non-zero status code. --- modules/textadept/editing.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/textadept') diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index cf449234..98f8da93 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -603,6 +603,11 @@ function M.filter_through(command) p:write(output) p:close() output = p:read('a') or '' + if p:wait() ~= 0 then + ui.statusbar_text = string.format('"%s" %s', commands[i], + _L['returned non-zero status']) + return + end end buffer:replace_target(output:iconv('UTF-8', _CHARSET)) if s ~= e then -- cgit v1.2.3