Fix active search going out of bounds

ft.font-size^2
Gonçalo Silva 2019-04-17 02:15:59 +01:00
parent fc824fc2ef
commit 567e74c99e
1 changed files with 1 additions and 4 deletions

View File

@ -143,10 +143,7 @@ class SearchAndReplace:
def scrollto(self, index): def scrollto(self, index):
if not self.matches: if not self.matches:
return return
if index < len(self.matches): self.active = index % len(self.matches)
self.active = index
else:
self.active = 0
match = self.matches[self.active] match = self.matches[self.active]
start_iter = self.textbuffer.get_iter_at_offset(match[0]) start_iter = self.textbuffer.get_iter_at_offset(match[0])