Skip to content

Formatting buffer causes cursor to jump to the bottom of file (and scrollbar to jump to the bottom if editor scrolled down at all) #21

@skillplan-derik

Description

@skillplan-derik

Specs

OS: Windows 11 Pro 25H2 (OS build 26200.7840)
Zed Version: 0.229.0
Extension: PowerShell v0.4.2

Description

In the editor window:

  1. If the scrollbar is at the top of the scrollable area, then formatting the buffer moves the text cursor to the end of the file.
  2. If the scrollbar isn't at the top of the scrollable area, then formatting the buffer moves the text cursor to the end of the file and the scrollbar jumps to the very bottom.

I also ran into an issue with a single file that would duplicate the last few lines of text at the end of the file when formatting buffer, but I wasn't able to reproduce the behaviour after I altered the file.

Example

Scrolled all the way up in the editor.

Before formatting buffer:
Image

After formatting buffer:
Image
Cursor moved to bottom of file.

Scrolled any amount down in the editor.

Before formatting buffer:
Image

After formatting buffer:
Image
Cursor moved to bottom of file and editor scrolled all the way down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions