Skip to content

Commit b71049a

Browse files
committed
Fix cider-insert-in-repl indenting too much
The intention was to indent the code that was just inserted. The bug was that the code grabbed the value of point from the source buffer instead of the repl buffer to mark the start position when indenting. The result, in most cases, was that the entire repl sessions was re-indented. As the repl can grow quite long this often brought emacs to a grinding halt.
1 parent 3487955 commit b71049a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cider-interaction.el

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,14 +1712,14 @@ 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+
(let ((start-pos (point)))
17191719
(insert form)
1720-
(indent-region start-pos (point))
1721-
(when eval
1722-
(cider-repl-return))))
1720+
(indent-region start-pos (point)))
1721+
(when eval
1722+
(cider-repl-return)))
17231723
(cider-switch-to-repl-buffer))
17241724

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

0 commit comments

Comments
 (0)