branch: elpa/kotlin-mode
commit c7f53d41375074bb3b145be02cf4444c434a462c
Author: Pieter Pareit <[email protected]>
Commit: Pieter Pareit <[email protected]>

    Save point and mark when sending a block to the interpreter
---
 kotlin-mode.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kotlin-mode.el b/kotlin-mode.el
index e5c7b92373..af1e8e5789 100644
--- a/kotlin-mode.el
+++ b/kotlin-mode.el
@@ -82,11 +82,11 @@
   (kotlin-do-and-repl-focus 'kotlin-send-buffer))
 
 (defun kotlin-send-block ()
+  "Send block to Kotlin interpreter."
   (interactive)
-  (let* ((p (point)))
+  (save-mark-and-excursion
     (mark-paragraph)
-    (kotlin-send-region (region-beginning) (region-end))
-    (goto-char p)))
+    (kotlin-send-region (region-beginning) (region-end))))
 
 (defun kotlin-send-block-and-focus ()
   "Send block to Kotlin interpreter and switch to it."

Reply via email to