Commit 0da4881c authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Made case-insensitive code completion really case-insensitive

There was still some "smartness" that made uppercase characters match
case-sensitive, regardless of the case-sensitivity setting. This annoyed
or at least confused many people who prefer case-insensitivity.

Reviewed-by: con
parent f37bc3d2
......@@ -1210,17 +1210,12 @@ void CppCodeCompletion::completions(QList<TextEditor::CompletionItem> *completio
if (c.isUpper() && !first) {
keyRegExp += QLatin1String("[a-z0-9_]*");
keyRegExp += c;
} else if (m_caseSensitivity == Qt::CaseInsensitive && c.isLower()) {
keyRegExp += QLatin1Char('[');
keyRegExp += c;
keyRegExp += c.toUpper();
keyRegExp += QLatin1Char(']');
} else {
keyRegExp += QRegExp::escape(c);
}
first = false;
}
const QRegExp regExp(keyRegExp, Qt::CaseSensitive);
const QRegExp regExp(keyRegExp, m_caseSensitivity);
foreach (TextEditor::CompletionItem item, m_completions) {
if (regExp.indexIn(item.m_text) == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment