diff --git a/CHANGELOG.md b/CHANGELOG.md index e56e028..2e5b482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog]. +## Unreleased +### Bugs fixed +* Apheleia experiences difficulty formatting buffers longer than 2^16 + characters. Previously, the formatting operation would fail entirely + in this case. Now it works, albeit with degraded performance. + ## 1.1.1 (released 2020-07-16) ### Formatters * New: [OCamlFormat](https://github.com/ocaml-ppx/ocamlformat) for diff --git a/apheleia.el b/apheleia.el index c616234..468609f 100644 --- a/apheleia.el +++ b/apheleia.el @@ -293,7 +293,7 @@ provided that its exit status is 0." (if (funcall (or exit-status (lambda (status) - (= 0 status))) + (= 0 (logand 255 status)))) (process-exit-status proc)) (when callback (funcall callback stdout)) @@ -315,7 +315,11 @@ provided that its exit status is 0." (with-current-buffer stdin (buffer-string)))) (process-send-eof apheleia--current-process)) - (error (message "Failed to run %s: %s" name (error-message-string e)))))) + (error + (unless (string-match-p + "process .+ no longer connected to pipe; closed it" + (error-message-string e)) + (message "Failed to run %s: %s" name (error-message-string e))))))) (defun apheleia--write-region-silently (start end filename &optional