glutanimate / highlight-search-results

Highlight Search Results in the Browser add-on for Anki
https://ankiweb.net/shared/info/225180905
Other
13 stars 5 forks source link

When searching, the browser automatically scrolls to the last instance of the term #14

Closed seales closed 1 year ago

seales commented 1 year ago

Suppose a card has multiple fields. And I search for term 'apple'. Every instance of 'apple' is highlighted, but it automatically scrolls to the bottom most instance in the browser.

Is it possible to keep the browser view originally at the first term instead of scrolling down automatically? I always find myself scrolling up immediately (naturally reading from the top down).

I tried changing this line[1] locally to basically list = list[-1] but the behavior still happened. Maybe I am not understanding some nuance of how anki renders its content.

What do you think? Thank you for this great addon!

[1] https://github.com/glutanimate/highlight-search-results/blob/master/src/highlight_search_results/browser.py#L121