Handle cloned buffers and give error message when not visiting a file #75
Open
Description
Currently, if I run prettier-js
inside a cloned buffer (created by clone-indirect-buffer
), prettier-js
will fail with an unhelpful error message. Looks like the issue is that it determines where to run the prettier
executable by calling buffer-file-name
, but buffer-file-name
is nil
inside cloned buffers. It would be better to either find the base file by calling (buffer-file-name (buffer-base-buffer))
or at least print a more readable error message.
Relatedly, running prettier-js
inside a buffer that's not visiting a file gives an unfriendly error message. prettier-js
could check whether the buffer has a file and if not, raise a descriptive error message.
I wrote a PR to try to fix this issue: #76
Metadata
Assignees
Labels
No labels