From bfe87b699a4e32c3285a43bc534c25004c0e0f7b Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 27 Aug 2018 21:22:53 +0300 Subject: [PATCH] Refactored cursorToEnd. --- src/widgets/splits/SplitInput.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp index ec548be7d..3502cb332 100644 --- a/src/widgets/splits/SplitInput.cpp +++ b/src/widgets/splits/SplitInput.cpp @@ -245,16 +245,14 @@ void SplitInput::installKeyPressedEvent() // Then simply get currMsg_. this->ui_.textEdit->setText(this->currMsg_); } else if (message != this->currMsg_) { - // If user is already in current message + // If user are already in current message // And type something new // Then replace currMsg_ with new one. this->currMsg_ = message; - } else { - // If user is already in current message - // And no changed text - // Then don't touch cursos. - cursorToEnd = false; } + // If user is already in current message + // Then don't touch cursos. + cursorToEnd = (message == this->prevMsg_.at(this->prevIndex_ - 1)); } if (cursorToEnd) {