Closed robertlzj closed 3 years ago
@robertlzj, indeed; thank you for the report!
It's caused by the fact that Scintilla InsertText call doesn't take the string length into account and stops at the first zero. I switched to a different method that should handle that. See if this patch fixes this for you:
diff --git a/src/editor/output.lua b/src/editor/output.lua
index d0523d28..67a0ff40 100644
--- a/src/editor/output.lua
+++ b/src/editor/output.lua
@@ -96,7 +96,9 @@ function DisplayOutputNoMarker(...)
local insertedAt = promptLine == wx.wxNOT_FOUND and out:GetLength() or out:PositionFromLine(promptLine) + inputBound
local current = out:GetReadOnly()
out:SetReadOnly(false)
- out:InsertTextDyn(insertedAt, out.useraw and message or FixUTF8(message, "\022"))
+ out:GotoPos(insertedAt)
+ local text = out.useraw and message or FixUTF8(message, "\022")
+ out:AddTextDyn(text)
out:EmptyUndoBuffer()
out:SetReadOnly(current)
out:GotoPos(out:GetLength())
Thanks. Now it will even print each control char on Scinilla's way.
Right; pushed the changes.