forked from qt-creator/qt-creator
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:
@@ -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:
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user