Skip to content

Commit 4f32dba

Browse files
committed
Merge pull request #1125 from clojure-emacs/insert-in-repl-bug
Fix cider-insert-in-repl indenting too much
2 parents 3487955 + d7062b0 commit 4f32dba

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cider-interaction.el

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,14 +1712,15 @@ the command `cider-debug-defun-at-point'."
17121712
(defun cider-insert-in-repl (form eval)
17131713
"Insert FORM in the REPL buffer and switch to it.
17141714
If EVAL is non-nil the form will also be evaluated."
1715-
(let ((start-pos (point)))
1716-
(while (string-match "\\`[ \t\n\r]+\\|[ \t\n\r]+\\'" form)
1717-
(setq form (replace-match "" t t form)))
1718-
(with-current-buffer (cider-current-repl-buffer)
1715+
(while (string-match "\\`[ \t\n\r]+\\|[ \t\n\r]+\\'" form)
1716+
(setq form (replace-match "" t t form)))
1717+
(with-current-buffer (cider-current-repl-buffer)
1718+
(goto-char (point-max))
1719+
(let ((beg (point)))
17191720
(insert form)
1720-
(indent-region start-pos (point))
1721-
(when eval
1722-
(cider-repl-return))))
1721+
(indent-region beg (point)))
1722+
(when eval
1723+
(cider-repl-return)))
17231724
(cider-switch-to-repl-buffer))
17241725

17251726
(defun cider-insert-last-sexp-in-repl (&optional arg)

0 commit comments

Comments
 (0)