Skip to content

Commit aa43713

Browse files
plexusbbatsov
authored andcommitted
Replace logical sexp in eval-sexp-and-replace
This function find the sexp to evaluate with `clojure-backward-logical-sexp`, but replaces it with `backward-kill-sexp`. This leads to incorrect results, e.g. when eval+replacing `#inst "2020"`, you get `#inst #inst "2020"`.
1 parent cc20841 commit aa43713

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
* Fix broken links to the docs in REPL warnings (the REPL links included the full CIDER version, but the docs URLs are without the patch version).
1212
* [#2916](https://github.com/clojure-emacs/cider/issues/2916): Fix ordering of dependencies, global-opts and params for Clojure CLI projects when calling `cider-jack-in`.
13+
* [#2929](https://github.com/clojure-emacs/cider/issues/2929): Fix handling of reader tags or metadata when calling `cider-eval-last-sexp-and-replace`
1314

1415
### Changes
1516

cider-eval.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,9 @@ buffer."
802802
;; we have to be sure the evaluation won't result in an error
803803
(cider-nrepl-sync-request:eval last-sexp)
804804
;; seems like the sexp is valid, so we can safely kill it
805-
(backward-kill-sexp)
805+
(let ((opoint (point)))
806+
(clojure-backward-logical-sexp)
807+
(kill-region (point) opoint))
806808
(cider-interactive-eval last-sexp
807809
(cider-eval-print-handler)
808810
nil

0 commit comments

Comments
 (0)