Editor: fix completion character completions

Cleanup the proposal after an item is activated even if the proposal
widget is not visible anymore. Otherwise we might wrongly cleanup a
proposal that was triggered by a completion character while a completion
list was already open.

Change-Id: Ie95247de09313c5816cffd9a865b05183db02354
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-10-19 13:47:27 +02:00
parent b0d4414dfc
commit a962a08b1a

View File

@@ -485,9 +485,10 @@ void CodeAssistantPrivate::destroyContext()
if (isWaitingForProposal()) {
cancelCurrentRequest();
} else if (isDisplayingProposal()) {
} else if (m_proposalWidget) {
m_editorWidget->keepAutoCompletionHighlight(false);
m_proposalWidget->closeProposal();
if (m_proposalWidget->isVisible())
m_proposalWidget->closeProposal();
disconnect(m_proposalWidget, &QObject::destroyed,
this, &CodeAssistantPrivate::finalizeProposal);
finalizeProposal();