From 10dd9c9a8c58c3a82ad90165ae9d25ef3f7da0b5 Mon Sep 17 00:00:00 2001 From: Christian Hoenig Date: Sun, 22 May 2011 08:51:30 +0200 Subject: [PATCH] Workaround to fix cursor movements with invisible cursor Task-number: QTCREATORBUG-4957 Change-Id: I730550b4d558a2d7fbe34a4052b6cfc5e27fe6e5 Reviewed-on: http://codereview.qt.nokia.com/71 Reviewed-by: Qt Sanity Bot Reviewed-by: Leandro T. C. Melo --- src/plugins/texteditor/basetexteditor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 211c7a8d983..d103b60d5ab 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -786,21 +786,29 @@ void BaseTextEditorWidget::gotoNextCharacterWithSelection() void BaseTextEditorWidget::gotoPreviousWord() { moveCursor(QTextCursor::PreviousWord); + // workaround to ensure blinking cursor is visible after move + setTextCursor(textCursor()); } void BaseTextEditorWidget::gotoPreviousWordWithSelection() { moveCursor(QTextCursor::PreviousWord, QTextCursor::KeepAnchor); + // workaround to ensure blinking cursor is visible after move + setTextCursor(textCursor()); } void BaseTextEditorWidget::gotoNextWord() { moveCursor(QTextCursor::NextWord); + // workaround to ensure blinking cursor is visible after move + setTextCursor(textCursor()); } void BaseTextEditorWidget::gotoNextWordWithSelection() { moveCursor(QTextCursor::NextWord, QTextCursor::KeepAnchor); + // workaround to ensure blinking cursor is visible after move + setTextCursor(textCursor()); } void BaseTextEditorWidget::gotoPreviousWordCamelCase()