Skip to content

Commit

Permalink
[Fix #2102] check-parens before middleware in cider-format-buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
gonewest818 authored and bbatsov committed Feb 17, 2018
1 parent 36f1934 commit 4ef2cea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions cider-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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)))))
Expand Down

0 comments on commit 4ef2cea

Please # to comment.