Draft: Fix search results getting cut off
This is a fix for #3601, which I have been using locally on 3.38.3 for a few weeks. The problems fixed here are:
- When more search results are present than are shown, using the right arrow key eventually moves the highlight out of the visible region (but the invisible result still selected). Confine the highlight to the visible results.
- When font scaling is enabled, sometimes the rightmost result shows up as a single vertical bar of pixels (because it seems there's no space for that result). Adjust how we compute the number of results to show accordingly.