ahrm / sioyek

Sioyek is a PDF viewer with a focus on textbooks and research papers
https://sioyek.info/
GNU General Public License v3.0
6.75k stars 219 forks source link

Change how goto_beginning, goto_top handle scrolling #1073

Open 7415963987456321 opened 2 months ago

7415963987456321 commented 2 months ago

Similar to the issue in #1039 but not quite the same since this PR only affects the commands. Currently when navigating to the top/bottom of the page using keyboard or entering command, sioyek will scroll past the page edge, I found this bothersome and I see no benefit to scrolling past the page like that.

7415963987456321 commented 2 months ago

Did not occur to me to check the development branch, at a quick glance it seems like these changes have not yet been implemented on there, will rebase these changes onto developer and test further.

HakonHarnes commented 1 month ago

Hope this PR gets merged. I also find it annoying how the gg the G commands scroll past the edge of the page.

However, I don't think it's a good idea to change how number repeats offsets the page. Having e.g. 2gg navigate to page 3 doesn't make sense. In my head 2gg translates to "go to page 2", and should go to page 2, not 3. The same principle is true in vim; 10gg will navigate to line 10, not line 11.

7415963987456321 commented 1 month ago

However, I don't think it's a good idea to change how number repeats offsets the page. Having e.g. 2gg navigate to page 3 doesn't make sense. In my head 2gg translates to "go to page 2", and should go to page 2, not 3. The same principle is true in vim; 10gg will navigate to line 10, not line 11.

Good point, don't generally use that feature of vim, or sioyek for that matter, just had a look at how vim is handling this, and I agree that this PR should behave the same way. Will revisit this at a later date when I have the time.