Fix bug in spacemacs//cider-eval-in-repl-no-focus
- Move to point-max before inserting text. - Only indent the newly inserted form instead of the whole buffer.
This commit is contained in:
parent
534dd9a5db
commit
7240654d32
|
@ -45,12 +45,13 @@
|
|||
|
||||
(defun spacemacs//cider-eval-in-repl-no-focus (form)
|
||||
"Insert FORM in the REPL buffer and eval it."
|
||||
(let ((start-pos (point)))
|
||||
(while (string-match "\\`[ \t\n\r]+\\|[ \t\n\r]+\\'" form)
|
||||
(setq form (replace-match "" t t form)))
|
||||
(with-current-buffer (cider-current-repl-buffer)
|
||||
(while (string-match "\\`[ \t\n\r]+\\|[ \t\n\r]+\\'" form)
|
||||
(setq form (replace-match "" t t form)))
|
||||
(with-current-buffer (cider-current-repl-buffer)
|
||||
(let ((pt-max (point-max)))
|
||||
(goto-char pt-max)
|
||||
(insert form)
|
||||
(indent-region start-pos (point))
|
||||
(indent-region pt-max (point))
|
||||
(cider-repl-return))))
|
||||
|
||||
(defun spacemacs/cider-send-last-sexp-to-repl ()
|
||||
|
|
Loading…
Reference in a new issue