Commit 6138bc3d authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

TextEditor: Fix proposals matching

The regular expression must match the beginning of the string.

Broke by 95310b28.

Task-number: QTCREATORBUG-19170
Change-Id: Id95751e35ff48792333745d07a07da50af703f8f
Reviewed-by: default avatarAndré Hartmann <aha_1980@gmx.de>
parent 35b7dfc3
......@@ -263,7 +263,7 @@ void GenericProposalModel::filter(const QString &prefix)
const QString lowerPrefix = prefix.toLower();
foreach (const auto &item, m_originalItems) {
const QString &text = item->text();
if (regExp.match(text).hasMatch()) {
if (regExp.match(text).capturedStart() == 0) {
m_currentItems.append(item);
if (text.startsWith(prefix)) {
// Direct match
......
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