Skip to content

PrettierAsync moves cursor to top of buffer #229

@sleeplesslord

Description

@sleeplesslord

Do you want to request a feature or report a bug?
Bug

What is the current/expected behavior?
Running PrettierAsync moves cursor to the top of the buffer when prettier ends up changing the amount of lines in the document (e.g by removing a newline in an empty object). The synchronous Prettier command doesn't do this.

e.g

const foo = () => {
}

:PrettierAsync

Content will (as expected) change to

const foo = () => {}

but the cursor will be moved to the top of the buffer

What version of vim-prettier are you using - (output of :PrettierVersion) ?
1.0.0-alpha

What version of prettier are you using - (output of :PrettierCliVersion) ?
1.19.1

What is your prettier executable path - (output of :PrettierCliPath) ?
~/Documents/project/node_modules/.bin/prettier

Did this work in previous versions of vim-prettier and/or prettier ?
Yes, this issue appeared when upgrading vim-prettier, in the same project with the same version of prettier.

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