Only clear search with :search if one is displayed

For some reason, calling search.clear() while no search is displayed causes the
backends to un-focus inputs, and with QtWebKit, even hinting can't focus them
again after that.
This commit is contained in:
Florian Bruhin 2017-07-17 14:58:02 +02:00
parent ee1707c4d4
commit 4a7fe25f66
2 changed files with 4 additions and 1 deletions

View File

@ -49,6 +49,8 @@ Changed
- Using `:download` now uses the page's title as filename. - Using `:download` now uses the page's title as filename.
- Using `:back` or `:forward` with a count now skips intermediate pages. - Using `:back` or `:forward` with a count now skips intermediate pages.
- When there are multiple messages shown, the timeout is increased. - When there are multiple messages shown, the timeout is increased.
- `:search` now only clears the search if one was displayed before, so pressing
`<Escape>` doesn't un-focus inputs anymore.
Fixes Fixes
~~~~~ ~~~~~

View File

@ -1744,7 +1744,8 @@ class CommandDispatcher:
""" """
self.set_mark("'") self.set_mark("'")
tab = self._current_widget() tab = self._current_widget()
tab.search.clear() if tab.search.search_displayed:
tab.search.clear()
if not text: if not text:
return return