diff --git a/CHANGELOG.md b/CHANGELOG.md index 239a96e78..fa9aa69c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ * [#1913](https://github.com/clojure-emacs/cider/issues/1913): Fix `cider-toggle-buffer-connection` to allow cycling of connection and restoring all connections in cljc buffers. * [#2148](https://github.com/clojure-emacs/cider/issues/2148): Fix `jump to definition` working properly when remote `cider-jack-in` and `cider-connect`. * Font-lock failed assertions even in tests that were evaluated interactively. +* [#2102](https://github.com/clojure-emacs/cider/issues/2102): Make `cider-format-buffer` handle mismatched parens gracefully. ### Changes diff --git a/cider-interaction.el b/cider-interaction.el index 7c9389e14..dd07b716b 100644 --- a/cider-interaction.el +++ b/cider-interaction.el @@ -1955,6 +1955,7 @@ of the buffer into a formatted string." (defun cider-format-buffer () "Format the Clojure code in the current buffer." (interactive) + (check-parens) (cider-ensure-connected) (cider--format-buffer #'cider-sync-request:format-code)) @@ -1964,6 +1965,7 @@ of the buffer into a formatted string." (defun cider-format-edn-buffer () "Format the EDN data in the current buffer." (interactive) + (check-parens) (cider-ensure-connected) (cider--format-buffer (lambda (edn) (cider-sync-request:format-edn edn (cider--pretty-print-width)))))