From 546aa5848275be29bc946360e59a41e9ac64a889 Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Sat, 26 May 2012 22:52:55 +0200 Subject: [PATCH] Fixed scrolling bug when searching backwards --- deluge/ui/console/modes/alltorrents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index def9bea9e..4f7f46470 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -843,7 +843,7 @@ class AllTorrents(BaseMode, component.Component): if n.find(search_string) >= 0: self.cursel = (i+1) if ((self.curoff - 4) > self.cursel): - self.curoff = self.cursel - 4 + self.curoff = max(1, self.cursel - 4) self.search_state = SEARCH_SUCCESS return self.search_state = SEARCH_START_REACHED