diff options
author | 2016-09-05 18:22:20 -0400 | |
---|---|---|
committer | 2016-09-05 18:22:20 -0400 | |
commit | 3797ae30ccbf7cd80835b65cbc97ad7d9d5468ff (patch) | |
tree | 45d6286c2dfba5ee62037b2ac64a64db49e54e61 /modules | |
parent | ee754a5cbdbe965658eb8a127d9c71aaf800d267 (diff) | |
download | textadept-3797ae30ccbf7cd80835b65cbc97ad7d9d5468ff.tar.gz textadept-3797ae30ccbf7cd80835b65cbc97ad7d9d5468ff.zip |
Better error handling in filter-through; modules/textadept/editing.lua
Diffstat (limited to 'modules')
-rw-r--r-- | modules/textadept/editing.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 238db220..3224a560 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -515,10 +515,10 @@ function M.filter_through(command) -- Use the whole buffer as input. buffer:target_whole_document() end - local p = spawn(command) + local p = assert(spawn(command)) p:write(buffer.target_text) p:close() - buffer:replace_target(p:read('*a'):iconv('UTF-8', _CHARSET)) + buffer:replace_target((p:read('*a') or ''):iconv('UTF-8', _CHARSET)) if s ~= e then buffer:set_sel(buffer.target_start, buffer.target_end) else |