Added highlighting for completion in name column.
This commit is contained in:
parent
9582162927
commit
5085844550
@ -196,13 +196,10 @@ class CompletionItemDelegate(QStyledItemDelegate):
|
|||||||
|
|
||||||
if index.parent().isValid():
|
if index.parent().isValid():
|
||||||
pattern = index.model().pattern
|
pattern = index.model().pattern
|
||||||
if index.column() == 0 and pattern:
|
repl = r'<span class="highlight">\g<0></span>'
|
||||||
repl = r'<span class="highlight">\g<0></span>'
|
text = re.sub(re.escape(pattern), repl, self._opt.text,
|
||||||
text = re.sub(re.escape(pattern), repl, self._opt.text,
|
flags=re.IGNORECASE)
|
||||||
flags=re.IGNORECASE)
|
self._doc.setHtml(text)
|
||||||
self._doc.setHtml(text)
|
|
||||||
else:
|
|
||||||
self._doc.setPlainText(self._opt.text)
|
|
||||||
else:
|
else:
|
||||||
self._doc.setHtml('<b>{}</b>'.format(html.escape(self._opt.text)))
|
self._doc.setHtml('<b>{}</b>'.format(html.escape(self._opt.text)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user