branch: elpa/lua-mode
commit f92ced5898ca963bf6113a6e0553b4a0e3b49d52
Author: immerrr <[email protected]>
Commit: immerrr <[email protected]>
lua-send-region: send extra printline
This avoids putting interpreter output onto the prompt line.
---
lua-mode.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lua-mode.el b/lua-mode.el
index b8532f0..843a727 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1692,7 +1692,9 @@ Otherwise, return START."
(lua-file (or (buffer-file-name) (buffer-name)))
(region-str (buffer-substring-no-properties start end))
(command
- (format "luamode_loadstring(%s, %s, %s)"
+ ;; Print empty line before executing the code so that the first line
+ ;; of output doesn't end up on the same line as current prompt.
+ (format "print(''); luamode_loadstring(%s, %s, %s);\n"
(lua-make-lua-string region-str)
(lua-make-lua-string lua-file)
lineno)))