Fix search not scrolling to ocurrences

master
Manuel Genovés 2020-03-20 03:44:43 +01:00
parent dc028353fe
commit 9bc8dcc19d
1 changed files with 7 additions and 0 deletions

View File

@ -152,8 +152,15 @@ class SearchAndReplace:
self.active = index % len(self.matches)
match = self.matches[self.active]
start_iter = self.textbuffer.get_iter_at_offset(match[0])
end_iter = self.textbuffer.get_iter_at_offset(match[1])
# create a mark at the start of the coincidence to scroll to it
mark = self.textbuffer.create_mark(None, start_iter, False)
self.textview.scroller.scroll_to_mark(mark, center=True)
# select coincidence
self.textbuffer.select_range(start_iter, end_iter)
def hide(self):