prettier / prettier/vim-prettier

Folds are broken after saving a JavaScript file

Open
#298 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
1.8k
Forks
137
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Reproduce the issue with vim-prettier 1.0.0-beta, Prettier 2.3.0, and syntax folding enabled while saving already formatted JavaScript; done means folds remain in their original positions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.