prettier-emacs icon indicating copy to clipboard operation
prettier-emacs copied to clipboard

Handle cloned buffers and give a friendly error message when not visiting a file

Open michaeldickens opened this issue 1 year ago • 0 comments

Fix for https://github.com/prettier/prettier-emacs/issues/75.

  1. Get the buffer file using (buffer-file-name (buffer-base-buffer)) instead of buffer-file-name. The new code also works with indirect buffers.
  2. In case the file can't be found, raise a helpful error message.

Note: I am not familiar at all with prettier-js, I just noticed this problem while trying to use it and the fix looked easy enough. Please check to make sure this PR doesn't screw anything up.

michaeldickens avatar Oct 27 '23 16:10 michaeldickens