forked from qt-creator/qt-creator
Editor: Highlight automatically inserted text
Keep the highlight as long as the cursor is directly behind the closing character and the editor is the focus widget. Change-Id: Ic1d4bac263e9d2f395791dad7ecdceb9d69635c5 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
committed by
David Schulz
parent
6a2e9a1f06
commit
9bacb3e33e
@@ -307,6 +307,7 @@ void CodeAssistantPrivate::displayProposal(IAssistProposal *newProposal, AssistR
|
||||
if (m_proposal->isCorrective())
|
||||
m_proposal->makeCorrection(m_editorWidget);
|
||||
|
||||
m_editorWidget->keepAutoCompletionHighlight(true);
|
||||
basePosition = m_proposal->basePosition();
|
||||
m_proposalWidget = m_proposal->createWidget();
|
||||
connect(m_proposalWidget, &QObject::destroyed,
|
||||
@@ -421,6 +422,7 @@ void CodeAssistantPrivate::destroyContext()
|
||||
if (isWaitingForProposal()) {
|
||||
cancelCurrentRequest();
|
||||
} else if (isDisplayingProposal()) {
|
||||
m_editorWidget->keepAutoCompletionHighlight(false);
|
||||
m_proposalWidget->closeProposal();
|
||||
disconnect(m_proposalWidget, &QObject::destroyed,
|
||||
this, &CodeAssistantPrivate::finalizeProposal);
|
||||
|
||||
Reference in New Issue
Block a user