Wrong algorithm in KateWildcardMatcher?
When I open a file named test_qmakefile.cpp in a ktexteditor-based editor (KDevelop, Kate, KWrite), it is highlighted as a Makefile. A cursory code search makes me believe that the reason is here. This code happily discards any number of characters at the beginning of candidate
in order to produce a match. The loop also looks very inefficient. I don't see a comment that states that this algorithm intentionally deviates from the standard meaning of *
in a wildcard. How about removing KateWildcardMatcher
code+tests and using QRegularExpression::wildcardToRegularExpression()
instead?
EDIT: the loop I linked to above actually seems to be correct if inefficient. The bug is probably after the exit from the outer loop: when the characters in the wildcard are exhausted, exactMatch()
unconditionally returns true, even if unmatched characters in candidate
remain.