From 6138bc3d41cde525f2c0f3fed806ad2b3d387f63 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 26 Oct 2017 17:23:27 +0300 Subject: [PATCH] TextEditor: Fix proposals matching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The regular expression must match the beginning of the string. Broke by 95310b28f3. Task-number: QTCREATORBUG-19170 Change-Id: Id95751e35ff48792333745d07a07da50af703f8f Reviewed-by: André Hartmann --- src/plugins/texteditor/codeassist/genericproposalmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/codeassist/genericproposalmodel.cpp b/src/plugins/texteditor/codeassist/genericproposalmodel.cpp index 0357bb80341..348f0a1eabc 100644 --- a/src/plugins/texteditor/codeassist/genericproposalmodel.cpp +++ b/src/plugins/texteditor/codeassist/genericproposalmodel.cpp @@ -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