Fix continuing a search after clearing it

Fixes #2438
This commit is contained in:
Florian Bruhin 2017-03-20 21:34:33 +01:00
parent 41268f994d
commit 3fbb9a14e0
3 changed files with 18 additions and 7 deletions

View File

@ -36,6 +36,7 @@ Fixed
(requires PyOpenGL to be installed)
- Fixed crash when trying to retry downloads with QtWebEngine
- Fixed crash when cloning page without history
- Fixed continuing a search after clearing it
v0.10.1
-------

View File

@ -1650,21 +1650,22 @@ class CommandDispatcher:
tab = self._current_widget()
tab.search.clear()
if not text:
return
options = {
'ignore_case': config.get('general', 'ignore-case'),
'reverse': reverse,
}
self._tabbed_browser.search_text = text
self._tabbed_browser.search_options = dict(options)
if text:
cb = functools.partial(self._search_cb, tab=tab,
old_scroll_pos=tab.scroller.pos_px(),
options=options, text=text, prev=False)
else:
cb = None
cb = functools.partial(self._search_cb, tab=tab,
old_scroll_pos=tab.scroller.pos_px(),
options=options, text=text, prev=False)
options['result_cb'] = cb
tab.search.search(text, **options)
@cmdutils.register(instance='command-dispatcher', hide=True,

View File

@ -110,6 +110,15 @@ Feature: Searching on a page
And I run :yank selection
Then the clipboard should contain "foo"
# https://github.com/qutebrowser/qutebrowser/issues/2438
Scenario: Jumping to next match after clearing
When I set general -> ignore-case to true
And I run :search foo
And I run :search
And I run :search-next
And I run :yank selection
Then the clipboard should contain "foo"
## :search-prev
Scenario: Jumping to previous match