Make completion highlighting case-insensitive again

Fixes #4297
This commit is contained in:
Florian Bruhin 2018-10-06 09:57:01 +02:00
parent fd48e29a54
commit 587b11f60d
2 changed files with 2 additions and 1 deletions

View File

@ -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)

View File

@ -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)]),