aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2011-03-29 01:27:49 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2011-03-29 01:27:49 -0400
commit5781a9e463cb69ee6a02848cccc3de57567dc46a (patch)
treeabde43d6c84bc6ce90a2ae4d21a25e38c2b238de
parent2567f768ea08abaf53e7e09f9103cfaa3c87d2d8 (diff)
downloadtextadept-5781a9e463cb69ee6a02848cccc3de57567dc46a.tar.gz
textadept-5781a9e463cb69ee6a02848cccc3de57567dc46a.zip
Handle nil args in gui.print() and set caret after printing.
-rw-r--r--core/gui.lua5
-rw-r--r--modules/textadept/run.lua1
2 files changed, 4 insertions, 2 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
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index fd021fab..65526386 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -37,7 +37,6 @@ function execute(command)
p:close()
lfs.chdir(current_dir)
gui.print(('> '..command..'\n'..out):iconv('UTF-8', _CHARSET))
- buffer:goto_pos(buffer.length)
end
-- Executes a compile or run command.