From df7bd3033e49672abe11f53318ba30a01ff85252 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 15 Aug 2017 19:50:07 +0200 Subject: GRAPHICS: MACGUI: Syncronise internal state when selection is cut --- graphics/macgui/mactextwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp index 9a1898b044..9bbf2c8d10 100644 --- a/graphics/macgui/mactextwindow.cpp +++ b/graphics/macgui/mactextwindow.cpp @@ -264,8 +264,11 @@ Common::String MacTextWindow::cutSelection() { } int selPos = selStart - _inputText.c_str(); + Common::String newInput = Common::String(_inputText.c_str(), selPos) + Common::String(_inputText.c_str() + selPos + selection.size()); - _inputText = Common::String(_inputText.c_str(), selPos) + Common::String(_inputText.c_str() + selPos + selection.size()); + clearSelection(); + clearInput(); + appendInput(newInput); return selection; } -- cgit v1.2.3