Skip to content

Folds are broken after saving a JavaScript file #298

Description

@pipoprods

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

A bug

What is the current/expected behavior?

Folds should remain well placed

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

1.0.0-beta, commit 37600923a25dded35bbf74c3f682d9807ef0b0ce

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

2.3.0

What is your prettier executable path - (output of :PrettierCliPath) ?

prettier (actually ~/.nvm/versions/node/v16.1.0/bin/prettier)

Did this work in previous versions of vim-prettier and/or prettier ?

Don't know

When saving a file whose formatting is already correct, folds are moved one line below.

Before:
2021-05-19_15-47

After:
2021-05-19_15-48

If the file is not properly formatted, then it gets auto-formatted and folds are keps at their right place.

JS folding is configured this way:

let javaScript_fold=1
set foldmethod=syntax

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions