diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | cider-interaction.el | 5 | ||||
-rw-r--r-- | cider-mode.el | 4 |
3 files changed, 10 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index bcc9b156..9aedfc17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Bugs fixed +* [#2310](https://github.com/clojure-emacs/cider/issues/2310): `cider-format-edn-last-sexp` will format the last sexp. * [#2294](https://github.com/clojure-emacs/cider/issues/2294): Fix setting default stacktrace filters. * [#2286](https://github.com/clojure-emacs/cider/issues/2286): Fix eldoc issue with images in the REPL. * [#2307](https://github.com/clojure-emacs/cider/pull/2307): Use a better error when a cljs repl form cannot be found. diff --git a/cider-interaction.el b/cider-interaction.el index 962bcd1d..e0f3f1af 100644 --- a/cider-interaction.el +++ b/cider-interaction.el @@ -1981,6 +1981,11 @@ START and END represent the region's boundaries." (lambda (edn) (cider-sync-request:format-edn edn right-margin))))) +(defun cider-format-edn-last-sexp () + "Format the EDN data of the last sexp." + (interactive) + (apply 'cider-format-edn-region (cider-sexp-at-point 'bounds))) + ;;; Interrupt evaluation diff --git a/cider-mode.el b/cider-mode.el index 10471619..5c7407eb 100644 --- a/cider-mode.el +++ b/cider-mode.el @@ -290,6 +290,10 @@ Configure `cider-cljs-repl-types' to change the ClojureScript REPL to use for yo ["Browse REPL input history" cider-repl-history] ["Browse classpath" cider-classpath] ["Browse classpath entry" cider-open-classpath-entry]) + ("Format" + ["Format EDN last sexp" cider-format-edn-last-sexp] + ["Format EDN region" cider-format-edn-region] + ["Format EDN buffer" cider-format-edn-buffer]) ("Macroexpand" ["Macroexpand-1" cider-macroexpand-1] ["Macroexpand-all" cider-macroexpand-all]) |