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

Panic message on malformed JSON causes Vim to replace file content with panic message #2

Open
ssokolow opened this issue Oct 1, 2022 · 0 comments

Comments

@ssokolow
Copy link

ssokolow commented Oct 1, 2022

I like to use jsonfmt as my equalprg filter for JSON files in Vim so I can reindent a file with a simple ==. However, if the file is malformed (eg. a hand-edited JSON file where I neglected to remove an extra comma after reordering a list), then that'll result in the JSON in my Vim buffer being replaced with jsonfmt's panic message.

As you might guess, this also makes it completely unsuitable for automatic format-on-save.

Would you be willing to consider something like a command-line switch which causes it to echo out the input unchanged and without any error messages if serde_json fails to parse the input?

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

1 participant