diff --git a/widget/editor.go b/widget/editor.go index 264a9929..30c6fb6d 100644 --- a/widget/editor.go +++ b/widget/editor.go @@ -645,14 +645,14 @@ func (e *Editor) Insert(s string) { } func (e *Editor) append(s string) { - if e.SingleLine { - s = strings.ReplaceAll(s, "\n", "") - } e.prepend(s) e.rr.caret += len(s) } func (e *Editor) prepend(s string) { + if e.SingleLine { + s = strings.ReplaceAll(s, "\n", " ") + } e.rr.prepend(s) e.caret.xoff = 0 e.invalidate()