History window does not scroll to selected search result
This happens on the head of the master branch (currently commit 638843ba). The head of the gajim_0.16 branch (currently commit 6d866b14) works fine, though.
Steps to reproduce:
- Open history window of a contact.
- Enter any search term.
- Select a result.
With the freshly checked out master, this leads to a stack trace:
Traceback (most recent call last):
File "/home/markus/src/gajim/src/history_window.py", line 603, in on_results_treeview_row_activated
self._scroll_to_result(unix_time)
File "/home/markus/src/gajim/src/history_window.py", line 628, in _scroll_to_result
self.history_textview.tv.scroll_to_mark(match_start_mark, 0, True)
TypeError: scroll_to_mark() takes exactly 6 arguments (4 given)
I added the missing (now non-optional?) parameters to the invocation of scroll_to_mark with sensible defaults:
self.history_textview.tv.scroll_to_mark(match_start_mark, 0, True, 0, 0.5)
With this change the call succeeds, but the text view does not always scroll to the correct position of the search result. What is working, however, is that the correct conversation is displayed and the first line of the message containing the search term is highlighted. It just is not scrolled to in most cases. Instead, the view and the scrollbar flicker for a moment. The end position of the scrollbar is often somewhere near the top position. Selecting the same search result multiple times in a row may also lead to a changed, but still incorrect, scrollbar position.
I could not spot any patterns while trying to narrow this down. It seems that some messages are more likely to be correctly scrolled to than others, but then again even for them it does not work every single time. Overall, when choosing a search result randomly it is much more likely for the text view not to scroll to the correct position.
Is anybody able to reproduce this?