forked from qt-creator/qt-creator
TextEditor: Fix proposals matching
The regular expression must match the beginning of the string.
Broke by 95310b28f3.
Task-number: QTCREATORBUG-19170
Change-Id: Id95751e35ff48792333745d07a07da50af703f8f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
35b7dfc37e
commit
6138bc3d41
@@ -263,7 +263,7 @@ void GenericProposalModel::filter(const QString &prefix)
|
|||||||
const QString lowerPrefix = prefix.toLower();
|
const QString lowerPrefix = prefix.toLower();
|
||||||
foreach (const auto &item, m_originalItems) {
|
foreach (const auto &item, m_originalItems) {
|
||||||
const QString &text = item->text();
|
const QString &text = item->text();
|
||||||
if (regExp.match(text).hasMatch()) {
|
if (regExp.match(text).capturedStart() == 0) {
|
||||||
m_currentItems.append(item);
|
m_currentItems.append(item);
|
||||||
if (text.startsWith(prefix)) {
|
if (text.startsWith(prefix)) {
|
||||||
// Direct match
|
// Direct match
|
||||||
|
|||||||
Reference in New Issue
Block a user