From 882dc7553655f067e75c6f952c12d2c1f81d2d67 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 11 Jul 2017 08:38:06 +0200 Subject: [PATCH] Set default count for AbstractHistory.back/.forward Otherwise, using back/forward mouse buttons will crash. --- qutebrowser/browser/browsertab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index e935589a7..b94172118 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -465,7 +465,7 @@ class AbstractHistory: def current_idx(self): raise NotImplementedError - def back(self, count): + def back(self, count=1): idx = self.current_idx() - count if idx >= 0: self._go_to_item(self._item_at(idx)) @@ -473,7 +473,7 @@ class AbstractHistory: self._go_to_item(self._item_at(0)) raise WebTabError("At beginning of history.") - def forward(self, count): + def forward(self, count=1): idx = self.current_idx() + count if idx < len(self): self._go_to_item(self._item_at(idx))