FuzzyMatcher: Handle digits as camel hump

Allow searching for "Fancy4PartThingy" with the
more intuitive pattern "f4pt" as well as with the
pattern "fpt" that already worked before.

Fixes: QTCREATORBUG-22671
Change-Id: I3a7c1a5b7f57d2f2bdd7d0c6e23b46f6bbb64d77
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2019-07-13 08:45:26 +02:00
committed by André Hartmann
parent 52a58afc79
commit 9f136678be
2 changed files with 19 additions and 4 deletions

View File

@@ -75,7 +75,7 @@ QRegularExpression FuzzyMatcher::createRegExp(
const QLatin1String upperSnakeWordContinuation("[A-Z0-9]*_");
keyRegExp += "(?:";
for (const QChar &c : pattern) {
if (!c.isLetter()) {
if (!c.isLetterOrNumber()) {
if (c == question) {
keyRegExp += '.';
plainRegExp += ").(";