mayScrollToCursor added padding to its scroll, scrolling a couple lines further than the cursor position if we were close to the bottom of the text editor.
onPointerEvent(Move) transitively called mayScrollToCursor even if the pointer didn't actually move. Since the cursor remains at the bottom of the screen as the padding is added and the cursor continues to include the newly scrolled into padded lines, the mayScrollToCursor scrolls to add padding again and we recurse.
We've corrected some faulty 'padding' logic, that sought to add padding to a cursor movement that caused recursive scrolling until the end of the file is reached and brought our behaviour more in line with other IDEs.
What is the goal of this PR?
We have fixed a bug that caused the text editor to scroll whenever text was highlighted at the bottom of the text editor:
What are the changes implemented in this PR?
This bug was caused by two interactions:
mayScrollToCursor
added padding to its scroll, scrolling a couple lines further than the cursor position if we were close to the bottom of the text editor.onPointerEvent(Move)
transitively calledmayScrollToCursor
even if the pointer didn't actually move. Since the cursor remains at the bottom of the screen as the padding is added and the cursor continues to include the newly scrolled into padded lines, the mayScrollToCursor scrolls to add padding again and we recurse.We've corrected some faulty 'padding' logic, that sought to add padding to a cursor movement that caused recursive scrolling until the end of the file is reached and brought our behaviour more in line with other IDEs.