From 750d2c490ff8baa8e76af7686df7fec6ae572594 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 22 Nov 2017 14:56:25 +0100 Subject: [PATCH] Fix :completion-item-focus --history with / or ? If we have no completion (like when searching), we can just always go through history with up/down. --- qutebrowser/completion/completionwidget.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index f6983dc4b..b72a14d3c 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -234,13 +234,10 @@ class CompletionView(QTreeView): which: 'next', 'prev', 'next-category', or 'prev-category'. history: Navigate through command history if no text was typed. """ - if not self._active: - return - if history: status = objreg.get('status-command', scope='window', window=self._win_id) - if status.text() == ':' or status.history.is_browsing(): + if status.text() == ':' or status.history.is_browsing() or not self._active: if which == 'next': status.command_history_next() return @@ -251,8 +248,10 @@ class CompletionView(QTreeView): raise cmdexc.CommandError("Can't combine --history with " "{}!".format(which)) - selmodel = self.selectionModel() + if not self._active: + return + selmodel = self.selectionModel() indices = { 'next': self._next_idx(upwards=False), 'prev': self._next_idx(upwards=True),