prettier-js doesn't report any error because it doesn't check for the return value of call-process-region on the diff command at line 189 like it does for the call-process on the prettier-js-command at line 185.
The error message is in the *Messages* buffer
Error: (file-error "Searching for program" "No such file or directory" "diff")
On Windows "diff" is not installed by default. I wonder if there is an elisp function that you could call instead to make it more cross platform?
I've kind of hacked it by adding C:\Program Files\Git\usr\bin\ to the PATH, but causes ^Ms to appear in the output file.
Which hilarously you can't remove as they come back on each save :)
After investigating the cause is diff, as it will be using dos line endings.
Adding --strip-trailing-cr to the diff options fixes the problem.
prettier-js doesn't report any error because it doesn't check for the return value of
call-process-region
on thediff
command at line 189 like it does for the call-process on theprettier-js-command
at line 185.The error message is in the
*Messages*
bufferOn Windows "diff" is not installed by default. I wonder if there is an elisp function that you could call instead to make it more cross platform?
I've kind of hacked it by adding
C:\Program Files\Git\usr\bin\
to thePATH
, but causes^M
s to appear in the output file.Which hilarously you can't remove as they come back on each save :)
After investigating the cause is diff, as it will be using dos line endings.
Adding
--strip-trailing-cr
to the diff options fixes the problem.