From a616af822eee470a823529342f46db77caf3e8df Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Thu, 25 Feb 2021 19:33:11 +0100 Subject: [PATCH] Fix Ctrl U/W behaviour to work with unicode text --- apps/openmw/mwgui/console.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/console.cpp b/apps/openmw/mwgui/console.cpp index 89ba5d388d..d0d3b87a69 100644 --- a/apps/openmw/mwgui/console.cpp +++ b/apps/openmw/mwgui/console.cpp @@ -249,7 +249,7 @@ namespace MWGui size_t length = mCommandLine->getTextCursor() - max; if(length > 0) { - std::string text = caption; + auto text = caption; text.erase(max, length); mCommandLine->setCaption(text); mCommandLine->setTextCursor(max); @@ -259,7 +259,7 @@ namespace MWGui { if(mCommandLine->getTextCursor() > 0) { - std::string text = mCommandLine->getCaption(); + auto text = mCommandLine->getCaption(); text.erase(0, mCommandLine->getTextCursor()); mCommandLine->setCaption(text); mCommandLine->setTextCursor(0);