From c62b6a5fa01b00f55fbeb62338c4c0108f251d80 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Thu, 8 Jun 2017 16:14:41 +0200 Subject: [PATCH] Clang: make correction whithout proposed items Make . to -> correction even in case code assistant has no items to propose. Change-Id: Ie16d317c1a55f05883d3de5ba9bd475d315c59a9 Reviewed-by: Nikolai Kosjar Reviewed-by: David Schulz --- src/plugins/texteditor/codeassist/codeassistant.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index 7073c3850ba..caff27918df 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -311,8 +311,11 @@ void CodeAssistantPrivate::displayProposal(IAssistProposal *newProposal, AssistR const QString prefix = m_editorWidget->textAt(basePosition, m_editorWidget->position() - basePosition); - if (!newProposal->hasItemsToPropose(prefix, reason)) + if (!newProposal->hasItemsToPropose(prefix, reason)) { + if (newProposal->isCorrective(m_editorWidget)) + newProposal->makeCorrection(m_editorWidget); return; + } if (destroyCurrentContext) destroyContext();