From 322b4d26d8b650340550871d0a1e5e75f817c63a Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sat, 12 Jan 2019 10:10:05 -0800 Subject: [PATCH] Fix match highlighting on qt 5.11.3 and 5.12.1+ For some reason, populating the text (even if we completely overwrite it later) before the highlighter is added results in no highlighting. I think this has something to do with python locking/delayed re-highlighting. At some point, it would be nice to file this as a bug, but I can't seem to make a small c++ example. See https://codereview.qt-project.org/#/c/244699/4//ALL and https://bugreports.qt.io/browse/QTBUG-71307 for more information. Closes #4519 --- qutebrowser/completion/completiondelegate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/completion/completiondelegate.py b/qutebrowser/completion/completiondelegate.py index 3ed5f0a64..b58f36372 100644 --- a/qutebrowser/completion/completiondelegate.py +++ b/qutebrowser/completion/completiondelegate.py @@ -212,11 +212,11 @@ class CompletionItemDelegate(QStyledItemDelegate): view = self.parent() pattern = view.pattern columns_to_filter = index.model().columns_to_filter(index) - self._doc.setPlainText(self._opt.text) if index.column() in columns_to_filter and pattern: pat = re.escape(pattern).replace(r'\ ', r'|') _Highlighter(self._doc, pat, config.val.colors.completion.match.fg) + self._doc.setPlainText(self._opt.text) else: self._doc.setHtml( '{}'.format(