Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: fixing race condition incorrect buffer formating #63

Merged

Conversation

mitermayer
Copy link
Member

If user saved file and changed buffer too fast there was a chance that it could add the previous formatting to the next buffer when using vim 8 async job

Fixes: #62

@mitermayer mitermayer merged commit cf42189 into master Oct 7, 2017
@alanhamlett
Copy link

Thanks! This causes prettier to not run on the saved file? Could we write back to the initial buffer instead of returning?

@mitermayer
Copy link
Member Author

mitermayer commented Oct 7, 2017

Hi @alanhamlett,

I split the fix in two steps. The first one is to unblock you first by making sure you don't accidentally get your other buffer overwritten.

I have filled a bug on vim to figure out more details around it (vim/vim#2193) they now have an API for handling this case, however that is only available for vim v8.0.1039+.

Will create a PR that will conditionally add support for that API for users of vim that has that fix in place.

In the meantime please upgrade your vim to a version over that so that when I do a new vim-prettier release you can leverage from that

@alanhamlett
Copy link

Oh awesome, thanks!

@mitermayer
Copy link
Member Author

@alanhamlett

I have managed to find a workaround that won't require you to update vim, please feel free to try the new 0.2.2 release version of vim-prettier!

@mitermayer mitermayer deleted the issue/62-buffer-one-can-overwrite-buffer-2-race-condition branch October 20, 2017 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants