search: fix viewport not moving if we tried to move it past the scrollback start

If the match was somewhere near the scrollback beginning, and if the
entire scrollback hadn't yet been filled, we ended up trying to move
the viewport past the beginning of the scrollback, which we then
adjusted in the wrong direction, causing the viewport to not move at
all.

Besides being a bad user experience, since the new match wasn't
visible, foot would also crash if you manually scrolled up to the
match.
This commit is contained in:
Daniel Eklöf 2020-08-12 18:45:35 +02:00
parent ef9bac5965
commit b01431e38f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 57 additions and 21 deletions

View file

@ -57,6 +57,9 @@
* Mouse cursor style in top and left margins.
* Selection is now **updated** when the cursor moves outside the grid
(https://codeberg.org/dnkl/foot/issues/70).
* Viewport sometimes not moving when doing a scrollback search.
* Crash when cancelling a scrollback search and the window had been
resized while searching.
### Security