forked from qt-creator/qt-creator
TextEditor: skip auto completion while suggestion is visible
The use can still explicitly request completions in that case via the keyboard shortcut. Change-Id: I4ed47232a24288c540d1357c0f876a1cdfcfec08 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -444,6 +444,7 @@ void CodeAssistantPrivate::automaticProposalTimeout()
|
||||
{
|
||||
if (isWaitingForProposal()
|
||||
|| m_editorWidget->multiTextCursor().hasMultipleCursors()
|
||||
|| m_editorWidget->suggestionVisible()
|
||||
|| (isDisplayingProposal() && !m_proposalWidget->isFragile())) {
|
||||
return;
|
||||
}
|
||||
|
@@ -5952,6 +5952,11 @@ void TextEditorWidget::clearSuggestion()
|
||||
d->clearCurrentSuggestion();
|
||||
}
|
||||
|
||||
bool TextEditorWidget::suggestionVisible() const
|
||||
{
|
||||
return d->m_suggestionBlock.isValid();
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
void TextEditorWidget::processTooltipRequest(const QTextCursor &c)
|
||||
{
|
||||
|
@@ -471,6 +471,7 @@ public:
|
||||
|
||||
void insertSuggestion(const QString &suggestion);
|
||||
void clearSuggestion();
|
||||
bool suggestionVisible() const;
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
void processTooltipRequest(const QTextCursor &c);
|
||||
|
Reference in New Issue
Block a user