-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
saving a file ignored in .prettierignore outputs part of the file back to the buffer #140
Comments
Hi @jesusgollonet, Thanks for reporting this issue. We will try to replicate this and comment in here our findings and in case we can confirm as a bug we will take action and try to fix it. |
It might not necessarily be caused by .prettierignore. Just now I got the same issue with a codebase that does not have .prettierignore or .prettierrc for that matter. I tried to disable other plugins to see if there was any strange interactions but couldn't find anything. I disabled vim-prettier and the issue was gone. Don't have any experience with vim plugins unfortunately so not sure if I can help figure it out, but if you need help debugging do ping me. I've had to disable it for now as this makes it unusable but will take a look when i get some time (I really like it otherwise) Cheers, |
I wonder if this could be a regression that we may have introduced in Also do you have any Please try using Plug 'prettier/vim-prettier', { 'tag': '0.2.6' } Sorry for this inconvenience and we would love to help understand why this is happening. It looks like prettier is being run twice and is then duplicating the output |
Hey! hah no need to be sorry. Glad to help pinpoint this It looks like a regression on This is the
However commenting those out didn't seem to change the behaviour (i.e: the bug was still present) I don't have a global Re: duplication, I was using |
Yeah there seem to be some related lines in this commit. Will check when back to a computer
62fdd10
…Sent from my iPhone
On 14 Jun 2018, at 17:36, Mitermayer Reis ***@***.***> wrote:
Hi @jesusgollonet
I wonder if this could be a regression that we may have introduced in 0.2.7 do you mind trying to run vim-prettier with version 0.2.6 to see if the issue still occurs ?
Also do you have any vim-prettier configuration settings defined on your .vimrc ? Do you have any global .prettierc setup anywhere ?
Please try using vim-prettier with older release by updating your .vimrc to this
Plug 'prettier/vim-prettier', { 'tag': '0.2.6' }
Sorry for this inconvenience and we would love to help understand why this is happening. It looks like prettier is being run twice and is then duplicating the output
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
cc @SamHowie ^^ |
@jesusgollonet do you mind trying to update your autocmd BufWritePre *.js,*.json,*.css,*.scss,*.less,*.graphql PrettierAsync:w to
The command Can you try updating your |
I have managed to reproduce your issue. It only occurs for me if a I can verify that @mitermayer's suggestion above will not fix the problem (though it is probably a good idea to make that change anyway ;) Now that I can reproduce it, I should be able to debug what's going on. If 0.2.6 is working for you, I suggest staying on that release until a fix is in place. Sorry for the inconvenience. |
I have managed to reproduce your issue. It only occurs for me if a I can verify that @mitermayer's suggestion above will not fix the problem (though it is probably a good idea to make that change anyway ;) Now that I can reproduce it, I should be able to debug what's going on. If 0.2.6 is working for you, I suggest staying on that release until a fix is in place. Sorry for the inconvenience! |
hey! no worries. I can also use
which doesn't seem to have the issue. Again, let me know if I can help in any way. |
Description
If a file is part of .prettierignore, when editing the file and saving i'll get part of the buffer echoed back to the buffer.
Simplest test case
index.js
.prettierignore
open
index.js
and save, you'll get the following contents on the buffersave again and you'll get
etc.
The expected behaviour is that editing files which are ignored folder should work correctly, i.e: vim-prettier should do nothing with them.
Versions
vim-prettier
0.2.7
prettier
1.13.5
:PrettierCliPath
prettier
Vim
VIM - Vi IMproved 8.1 (2016 Sep 12, compiled Oct 2 2017 08:19:22) MacOS X (unix) version
It feels related to #92 but not sure
FWIW in vim 8.0.2 this bug was manifesting in completely blocking vim. I upgraded just now to see if that would fix it.
Cheers
The text was updated successfully, but these errors were encountered: