diff options
author | 2011-03-29 01:27:49 -0400 | |
---|---|---|
committer | 2011-03-29 01:27:49 -0400 | |
commit | 5781a9e463cb69ee6a02848cccc3de57567dc46a (patch) | |
tree | abde43d6c84bc6ce90a2ae4d21a25e38c2b238de /core/gui.lua | |
parent | 2567f768ea08abaf53e7e09f9103cfaa3c87d2d8 (diff) | |
download | textadept-5781a9e463cb69ee6a02848cccc3de57567dc46a.tar.gz textadept-5781a9e463cb69ee6a02848cccc3de57567dc46a.zip |
Handle nil args in gui.print() and set caret after printing.
Diffstat (limited to 'core/gui.lua')
-rw-r--r-- | core/gui.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/gui.lua b/core/gui.lua index 4a67b220..3cb97dfe 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -44,8 +44,11 @@ function gui._print(buffer_type, ...) gui.goto_view(message_view_index, true) end end - buffer:append_text(table.concat({...}, '\t')) + local args, n = {...}, select('#', ...) + for i = 1, n do args[i] = tostring(args[i]) end + buffer:append_text(table.concat(args, '\t')) buffer:append_text('\n') + buffer:goto_pos(buffer.length) buffer:set_save_point() end pcall(safe_print, ...) -- prevent endless loops on error |