Fix handling of spaces in completion
This is a regression introduced in
faa052ad6f
.
Fixes #1934.
This commit is contained in:
parent
861ce478b3
commit
0a3853fcb7
@ -69,7 +69,7 @@ class CompletionFilterModel(QSortFilterProxyModel):
|
||||
with debug.log_time(log.completion, 'Setting filter pattern'):
|
||||
self.pattern = val
|
||||
val = re.escape(val)
|
||||
val = val.replace(r'\ +', r'.*')
|
||||
val = re.sub(r'\ +', r'.*', val)
|
||||
self.pattern_re = re.compile(val, re.IGNORECASE)
|
||||
self.invalidate()
|
||||
sortcol = 0
|
||||
|
@ -62,6 +62,8 @@ def _extract_model_data(model):
|
||||
|
||||
@pytest.mark.parametrize('pattern, data, expected', [
|
||||
('foo', 'barfoobar', True),
|
||||
('foo bar', 'barfoobar', True),
|
||||
('foo bar', 'barfoobar', True),
|
||||
('foo', 'barFOObar', True),
|
||||
('Foo', 'barfOObar', True),
|
||||
('ab', 'aonebtwo', False),
|
||||
|
Loading…
Reference in New Issue
Block a user