mate-desktop / pluma

A powerful text editor for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
158 stars 66 forks source link

Scroll bar scrolls to top/bottom after pageup/pagedown twice #629

Open Yetoo1 opened 3 years ago

Yetoo1 commented 3 years ago

Expected behaviour

Moving the scrollbar thumb to the top of the page then pressing page up causes the page to go up one page and then a subsequent page up press causes the page to go up one page.

Moving the scrollbar thumb to the bottom of the page then pressing page down causes the page to go down one page and then a subsequent page down press causes the page to go down one page.

Actual behaviour

Moving the scrollbar thumb to the top of the page then pressing page up causes the page to go up one page and then a subsequent page up press causes the page to go to the top of the page.

Moving the scrollbar thumb to the bottom of the page then pressing page down causes the page to go down one page and then a subsequent page down press causes the page to go to the bottom of the page.

Steps to reproduce the behaviour

For top of page issue:

  1. Have a long document.
  2. Move scrollbar thumb to the middle of the scrollbar.
  3. Click somewhere in the page content with the scrollbar in that position.
  4. Move the scrollbar thumb to the top of the page.
  5. Press Page Up
  6. Press Page Up again.
  7. Notice the page goes all the way to the top of the page instead of just going one page up.

For bottom of page issue:

  1. Have a long document.
  2. Move scrollbar thumb to the middle of the scrollbar.
  3. Click somewhere in the page content with the scrollbar in that position.
  4. Move the scrollbar thumb to the bottom of the page.
  5. Press Page Down
  6. Press Page Down again.
  7. Notice the page goes all the way to the bottom of the page instead of just going one page down.

Notes: The scrollbar thumb doesn't necessarily have to be in the middle of the page, but it helps reproduce the issue. Also, the page contents don't necessarily need to be clicked when moving the scroll thumb down, but it helps reproduce the issue. What happens is the cursor goes to the very top or bottom of the page if page up or page down is pressed until it can't be pressed with effect anymore and can be confusing when no action happens to reproduce this since the cursor needs to initially be somewhere that's not the very top or bottom of the page for steps 4-7 to work.

This may be due to the cursor position being reset when the scroll thumb reaches the end or top of the document by step 6 instead of maintaining the state from the previous page up/page down.

This issue also occurs in gedit (at least 3.38.2).

Pluma version

master (1.25.3)

MATE general version

1.25.2

Linux Distribution

Fedora