fix lint, highlight properly
This commit is contained in:
parent
1f3a8a60d8
commit
4caffccca6
@ -198,8 +198,8 @@ 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), repl, self._opt.text,
|
||||
flags=re.IGNORECASE)
|
||||
text = re.sub(re.escape(pattern).replace(r'\ ', r'|'),
|
||||
repl, self._opt.text, flags=re.IGNORECASE)
|
||||
self._doc.setHtml(text)
|
||||
else:
|
||||
self._doc.setPlainText(self._opt.text)
|
||||
|
@ -71,7 +71,8 @@ class CompletionFilterModel(QSortFilterProxyModel):
|
||||
"""
|
||||
with debug.log_time(log.completion, 'Setting filter pattern'):
|
||||
self.pattern = val
|
||||
self.patternre = re.compile(re.escape(val.casefold()).replace("\ ", ".*"))
|
||||
self.patternre = re.compile(re.escape(val.casefold())
|
||||
.replace(r'\ ', r'.*'))
|
||||
self.invalidateFilter()
|
||||
sortcol = 0
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user