prettier / prettier/vim-prettier

Bug: Switching pane to terminal pane before Prettier finishes inserts strange characters

Open
#239 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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?
bug

What is the current/expected behavior?
Current:

  1. Save buffer
  2. Move to :term window while prettier is running in the background
  3. Vim freezes
  4. press ctrl+c, "Can't parse buffer" error appears.
    bug00
  5. Go back to original pane, there are strange characters on top of the file
    bug0

Expected:
vim-prettier can still update the old pane if you move to a term pane before it finishes

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) ?
2.0.5^@

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

Did this work in previous versions of vim-prettier and/or prettier ?
Not sure, I recently switched from tmux to :term. I've been seeing occasionally at work but finally can repro consistently on my rasbperry pi since it's slower and gives me time to switch panes before prettier finishes.

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

Reproduce the issue in vim-prettier by saving a buffer, switching to a :term pane while Prettier runs, and interrupting it if Vim freezes. Trace the asynchronous formatting path involved in updating the original pane. Done means switching panes does not insert strange characters, freeze Vim, or produce a "Can't parse buffer" error.

Written by the indexing model from the issue text.

Assessment

Tech stack
vim
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.