Merge remote-tracking branch 'origin/pr/3510'

This commit is contained in:
Florian Bruhin 2018-01-24 21:33:04 +01:00
commit 961eebaf71

View File

@ -203,9 +203,9 @@ class CompletionItemDelegate(QStyledItemDelegate):
columns_to_filter = index.model().columns_to_filter(index)
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'|'),
repl, html.escape(self._opt.text),
flags=re.IGNORECASE)
pat = html.escape(re.escape(pattern)).replace(r'\ ', r'|')
txt = html.escape(self._opt.text)
text = re.sub(pat, repl, txt, flags=re.IGNORECASE)
self._doc.setHtml(text)
else:
self._doc.setPlainText(self._opt.text)