QmlDesigner: Avoid jumping cursors in integrated text editor

If the curser changes this should not trigger an update in
the other direction.

Change-Id: Ie20914f5587525f46f2941de21374f4373cec47f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2019-04-02 14:43:22 +02:00
committed by Tim Jenssen
parent 257e45b4ec
commit d098016bd9
4 changed files with 11 additions and 1 deletions

View File

@@ -172,7 +172,8 @@ void TextEditorView::nodeIdChanged(const ModelNode& /*node*/, const QString &/*n
void TextEditorView::selectedNodesChanged(const QList<ModelNode> &/*selectedNodeList*/,
const QList<ModelNode> &/*lastSelectedNodeList*/)
{
m_widget->jumpTextCursorToSelectedModelNode();
if (!m_errorState)
m_widget->jumpTextCursorToSelectedModelNode();
}
void TextEditorView::customNotification(const AbstractView * /*view*/, const QString &identifier, const QList<ModelNode> &/*nodeList*/, const QList<QVariant> &/*data*/)
@@ -187,9 +188,11 @@ void TextEditorView::documentMessagesChanged(const QList<DocumentMessage> &error
{
if (errors.isEmpty()) {
m_widget->clearStatusBar();
m_errorState = false;
} else {
const DocumentMessage &error = errors.constFirst();
m_widget->setStatusText(QString("%1 (Line: %2)").arg(error.description()).arg(error.line()));
m_errorState = true;
}
}