Skip to content

primary_cursor_line_number is inaccurate when newlines are deleted with the Delete key #1261

@Koei32

Description

@Koei32

When you delete newlines below the cursor with the delete key, the cursor position (in terms of line number) does not change. However, the line number in the status bar does not reflect the same. It instead decreases by 1 as if the lines were deleted with backspace. This causes the line number to be out of sync of the actual cursor position, until it gets updated by another event (such as moving the cursor).

This is likely due to EditorState.apply_delete() treating all Delete events the same by decrementing primary_cursor_line_number by the number of newlines deleted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions