Editor: update proposal widget after editor contents changed

Also when text is removed via shortcuts.

Fixes: QTCREATORBUG-15038
Change-Id: I1c78b9306594fbf13378a55b27be18769de141a6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-02-12 10:36:09 +01:00
parent 75972f04f6
commit 909cb3859b
3 changed files with 2 additions and 7 deletions

View File

@@ -292,8 +292,6 @@ bool FunctionHintProposalWidget::eventFilter(QObject *obj, QEvent *e)
if (d->m_model && d->m_model->size() > 1)
return false;
}
if (QTC_GUARD(d->m_assistant))
d->m_assistant->notifyChange();
}
break;
case QEvent::WindowDeactivate:

View File

@@ -665,8 +665,6 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
}
QApplication::sendEvent(const_cast<QWidget *>(d->m_underlyingWidget), e);
if (isVisible())
d->m_assistant->notifyChange();
return true;
}

View File

@@ -741,7 +741,6 @@ public:
QTimer m_highlightBlocksTimer;
CodeAssistant m_codeAssistant;
bool m_assistRelevantContentAdded = false;
QList<BaseHoverHandler *> m_hoverHandlers; // Not owned
HoverHandlerRunner m_hoverHandlerRunner;
@@ -1502,8 +1501,8 @@ void TextEditorWidgetPrivate::editorContentsChange(int position, int charsRemove
snippetCheckCursor(cursor);
}
if (charsAdded != 0 && q->document()->characterAt(position + charsAdded - 1).isPrint())
m_assistRelevantContentAdded = true;
if ((charsAdded != 0 && q->document()->characterAt(position + charsAdded - 1).isPrint()) || charsRemoved != 0)
m_codeAssistant.notifyChange();
int newBlockCount = doc->blockCount();
if (!q->hasFocus() && newBlockCount != m_blockCount) {