completion: highlight only the matched terms

closes #1650
This commit is contained in:
Jakub Klinkovský 2016-07-15 22:30:48 +02:00
parent caf5937585
commit 49327dfcbb

View File

@ -200,7 +200,7 @@ class CompletionItemDelegate(QStyledItemDelegate):
columns_to_filter = index.model().srcmodel.columns_to_filter
if index.column() in columns_to_filter and pattern:
repl = r'<span class="highlight">\g<0></span>'
text = re.sub(re.escape(pattern).replace(r'\ ', r'.*'),
text = re.sub(re.escape(pattern).replace(r'\ ', r'|'),
repl, self._opt.text, flags=re.IGNORECASE)
self._doc.setHtml(text)
else: