From 567e74c99ea90e16cf5c2046bd56b60c0cd66a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Silva?= Date: Wed, 17 Apr 2019 02:15:59 +0100 Subject: [PATCH] Fix active search going out of bounds --- uberwriter/search_and_replace.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/uberwriter/search_and_replace.py b/uberwriter/search_and_replace.py index f137707..24fb1d9 100644 --- a/uberwriter/search_and_replace.py +++ b/uberwriter/search_and_replace.py @@ -143,10 +143,7 @@ class SearchAndReplace: def scrollto(self, index): if not self.matches: return - if index < len(self.matches): - self.active = index - else: - self.active = 0 + self.active = index % len(self.matches) match = self.matches[self.active] start_iter = self.textbuffer.get_iter_at_offset(match[0])