From a962a08b1ae2d600ec77f8efddb75a8402a8d084 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 19 Oct 2020 13:47:27 +0200 Subject: [PATCH] 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 --- src/plugins/texteditor/codeassist/codeassistant.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index 815be89bbaa..05f3c8ae17b 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -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();