Highlighting single characters

only if you're searching for whole words

Task-number: QTCREATORBUG-6372
Change-Id: I10700258cacdc5af52554824a971041d6a1c2b22
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
David Schulz
2012-01-11 13:52:45 +01:00
committed by Leandro Melo
parent f04be782ab
commit f09e849c96

View File

@@ -4850,8 +4850,9 @@ void BaseTextEditorWidget::markBlocksAsChanged(QList<int> blockNumbers)
void BaseTextEditorWidget::highlightSearchResults(const QString &txt, Find::FindFlags findFlags)
{
QString pattern = txt;
if (pattern.size() < 2)
pattern.clear(); // highlighting single characters is a bit pointless
// highlighting single characters only if you're searching for whole words
if (pattern.size() < 2 && !(findFlags & Find::FindWholeWords))
pattern.clear();
if (d->m_searchExpr.pattern() == pattern)
return;