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