use greedy highlighting

This commit is contained in:
Milan Svoboda 2016-01-06 21:52:56 +01:00
parent ec8dc35a68
commit 20cdb45da5

View File

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