summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyl20bnr <sylvain.benner@gmail.com>2015-02-23 22:25:27 -0500
committersyl20bnr <sylvain.benner@gmail.com>2015-02-27 20:30:03 -0500
commit8502a3f670cb673899b28b3a48ea0e36f477e39e (patch)
tree22f1f810e8889f39f6eeb45f5bb0f8422606c07a
parente2775111a05c7c19d19152c5727c107e9c7f724b (diff)
Add function cider-insert-region-in-repl
-rw-r--r--CHANGELOG.md1
-rw-r--r--cider-interaction.el7
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 89d6627a..993fbd9d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@
* [#949](https://github.com/clojure-emacs/cider/issues/949): New custom var: `cider-default-repl-command`.
* New code formatting commands - `cider-format-buffer`, `cider-format-region` and `cider-format-defun`.
* New data formatting commands - `cider-format-edn-buffer` and `cider-format-edn-region`.
+* New insert region in REPL command - `cider-insert-region-in-repl`.
* Pretty printing functionality moved to middleware, adding support for ClojureScript.
- New command to eval and pprint result: `cider-interactive-pprint-eval`.
- `cider-format-pprint-eval` has been removed.
diff --git a/cider-interaction.el b/cider-interaction.el
index 5e014fdd..9dc1cb83 100644
--- a/cider-interaction.el
+++ b/cider-interaction.el
@@ -1496,6 +1496,13 @@ If invoked with a prefix ARG eval the expression after inserting it."
(interactive "P")
(cider-insert-in-repl (cider-defun-at-point) arg))
+(defun cider-insert-region-in-repl (start end &optional arg)
+ "Insert the curent region in the REPL buffer.
+If invoked with a prefix ARG eval the expression after inserting it."
+ (interactive "rP")
+ (cider-insert-in-repl
+ (buffer-substring-no-properties start end) arg))
+
(defun cider-insert-ns-form-in-repl (&optional arg)
"Insert the current buffer's ns form in the REPL buffer.
If invoked with a prefix ARG eval the expression after inserting it."