forked from qt-creator/qt-creator
TextEditor: avoid showing suggestion and completion simultaneously
If the use erxplicitly requested the completion hide the suggestion otherwise ignore the completion. Change-Id: I52485e322b0521b0af10ae6945437bf96642ad89 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -252,6 +252,14 @@ void CodeAssistantPrivate::displayProposal(IAssistProposal *newProposal, AssistR
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_editorWidget->suggestionVisible()) {
|
||||||
|
if (reason != ExplicitlyInvoked) {
|
||||||
|
destroyContext();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_editorWidget->clearSuggestion();
|
||||||
|
}
|
||||||
|
|
||||||
const QString prefix = m_editorWidget->textAt(basePosition,
|
const QString prefix = m_editorWidget->textAt(basePosition,
|
||||||
m_editorWidget->position() - basePosition);
|
m_editorWidget->position() - basePosition);
|
||||||
if (!newProposal->hasItemsToPropose(prefix, reason)) {
|
if (!newProposal->hasItemsToPropose(prefix, reason)) {
|
||||||
|
Reference in New Issue
Block a user