Skip to content

Action lineMoveDown will jump to arbitrary position in the attempt to make the cursor visible #59

Open

Description

@TomKrauss

Pressing key down and reaching the end of the page will not scroll by one line, but by an arbitrary amount of lines in the attempt to make the caret visible on the screen.

Expected behavior
I would expect the screen in this case to scroll by one line - same behavior as if I scroll up, which will also always scroll the screen by one line, when we reach the top of the screen.

Device:

  • all platforms

Additional context
This behavior is caused by method _CodeField.makePositionVisible line 550. In my opinion this line should be corrected from:

Current code:

if (position.index > last.index) {
    _verticalViewport.jumpTo(max(0, last.bottom - size.height + _preferredLineHeight * (position.index - first.index)));
}

Correct code (replace first.index by last.index):

if (position.index > last.index) {
    _verticalViewport.jumpTo(max(0, last.bottom - size.height + _preferredLineHeight * (position.index - last.index)));
}

Activity

  1. added
    bug
    on Jan 6, 2025
  2. added a commit that references this issue on Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions