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

Format without saving #116

Closed
nikolvs opened this issue Feb 28, 2018 · 6 comments
Closed

Format without saving #116

nikolvs opened this issue Feb 28, 2018 · 6 comments

Comments

@nikolvs
Copy link

nikolvs commented Feb 28, 2018

Is there a way to format a file without automatically saving it? I read the docs, but didn't find anything about it there. If not, is it possible to implement this feature as an option? Thanks!

@mitermayer
Copy link
Member

mitermayer commented Mar 1, 2018

Hi @nikolvs,

Thanks for raising this question. Prettier async always saves the file, but if you run the synchronous version it should'nt save it.

:Prettier

One common problem is when you setup your .vimrc to use async by default with:

let g:prettier#exec_cmd_async = 1

The above will cause :Prettier to run as an alias for :PrettierAsync.

@mitermayer
Copy link
Member

Please try the above and let me know if that solve your problem (removing the flag that forces async formatting from your .vimrc)

@mitermayer
Copy link
Member

mitermayer commented Mar 1, 2018

I also wonder how could we solve this problem differently, Im not sure if adding yet another configuration option is the right solution since that would make things even harder to configure

@nikolvs
Copy link
Author

nikolvs commented Mar 1, 2018

Hey @mitermayer, that solved my problem! Thanks!!

@nikolvs nikolvs closed this as completed Mar 1, 2018
@AngeloMateus
Copy link

Is there any chance async would work without saving the buffer?

@mitermayer
Copy link
Member

@AngeloMateus feel free to submit this as a separate issue and I can look into it, should not be a problem.

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

No branches or pull requests

3 participants