diff --git a/qutebrowser/completion/completiondelegate.py b/qutebrowser/completion/completiondelegate.py index 6b1309378..e0e56e023 100644 --- a/qutebrowser/completion/completiondelegate.py +++ b/qutebrowser/completion/completiondelegate.py @@ -45,7 +45,7 @@ class _Highlighter(QSyntaxHighlighter): def highlightBlock(self, text): """Override highlightBlock for custom highlighting.""" - for match in re.finditer(self._pattern, text): + for match in re.finditer(self._pattern, text, re.IGNORECASE): start, end = match.span() length = end - start self.setFormat(start, length, self._format) diff --git a/tests/unit/completion/test_completiondelegate.py b/tests/unit/completion/test_completiondelegate.py index f9f6dc492..2d122927d 100644 --- a/tests/unit/completion/test_completiondelegate.py +++ b/tests/unit/completion/test_completiondelegate.py @@ -28,6 +28,7 @@ from qutebrowser.completion import completiondelegate @pytest.mark.parametrize('pat,txt,segments', [ ('foo', 'foo', [(0, 3)]), ('foo', 'foobar', [(0, 3)]), + ('foo', 'FOObar', [(0, 3)]), # re.IGNORECASE ('foo', 'barfoo', [(3, 3)]), ('foo', 'barfoobaz', [(3, 3)]), ('foo', 'barfoobazfoo', [(3, 3), (9, 3)]),