forked from qt-creator/qt-creator
Avoid retriggering the completion box when it's already there
There should be no need for the text editor to request an update of the completion box, since when it's there it will have focus and update itself. Reviewed-by: Roberto Raggi
This commit is contained in:
@@ -1415,6 +1415,9 @@ void BaseTextEditor::_q_requestAutoCompletion()
|
||||
{
|
||||
d->m_requestAutoCompletionTimer->stop();
|
||||
|
||||
if (CompletionSupport::instance()->isActive())
|
||||
return;
|
||||
|
||||
if (d->m_requestAutoCompletionRevision == document()->revision() &&
|
||||
d->m_requestAutoCompletionPosition == position())
|
||||
emit requestAutoCompletion(editableInterface(), false);
|
||||
|
||||
@@ -93,6 +93,11 @@ void CompletionSupport::cleanupCompletions()
|
||||
}
|
||||
}
|
||||
|
||||
bool CompletionSupport::isActive() const
|
||||
{
|
||||
return m_completionList != 0;
|
||||
}
|
||||
|
||||
void CompletionSupport::autoComplete(ITextEditable *editor, bool forced)
|
||||
{
|
||||
autoComplete_helper(editor, forced, /*quickFix = */ false);
|
||||
|
||||
@@ -55,6 +55,9 @@ public:
|
||||
CompletionSupport();
|
||||
|
||||
static CompletionSupport *instance();
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
public slots:
|
||||
void autoComplete(TextEditor::ITextEditable *editor, bool forced);
|
||||
void quickFix(TextEditor::ITextEditable *editor);
|
||||
|
||||
Reference in New Issue
Block a user