From 414f7bec9b5f7e0bb33cfee95a79c3670f109608 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 6 Mar 2025 10:56:29 -0500 Subject: [PATCH] Remove all CR characters when inserting text in TextField. --- src/ui/TextField.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ui/TextField.cpp b/src/ui/TextField.cpp index c12a31f4..f2830530 100644 --- a/src/ui/TextField.cpp +++ b/src/ui/TextField.cpp @@ -325,6 +325,9 @@ std::string TextField::getSelectedText() { } void TextField::insertText(std::string text) { + // Rack uses UNIX newlines so remove all CR characters + text.erase(std::remove(text.begin(), text.end(), '\r'), text.end()); + bool changed = false; if (cursor != selection) { // Delete selected text