Completion: Fine tuning perfect match behavior

Keeping or not the completion popup upon a perfect match
is best identified by the model in question instead of simply
by the triggering reason. For instance, in QML we don't want
to preserve the popup if completion was triggered by an
activation sequence. On the other hand, this is ok for C++
since a semicolon or parenthesis will in general still be
typed (in some cases even with the intention to take advantage
of the automatic bracked insertion).

For more context see 271bd44d2c1daa43c125cc09e6af57bb756de857.

Change-Id: If9dbf33243b623c077ce027e7e46265d0fc4ba8b
Reviewed-on: http://codereview.qt.nokia.com/563
Reviewed-by: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl>
This commit is contained in:
Leandro Melo
2011-06-21 15:11:16 +02:00
committed by Leandro T. C. Melo
parent 3ed88e1282
commit d4e9b862fa
6 changed files with 17 additions and 2 deletions

View File

@@ -852,3 +852,8 @@ void QmlJSAssistProposalModel::sort()
{
qSort(currentItems().first, currentItems().second, QmlJSLessThan());
}
bool QmlJSAssistProposalModel::keepPerfectMatch(TextEditor::AssistReason reason) const
{
return reason == ExplicitlyInvoked;
}