summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elisp/geiser-repl.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 3bde43e..2cd7729 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -852,7 +852,12 @@ evaluated without having to press ENTER."
(defun geiser-repl--superparen-function ()
(when (char-equal (char-before) geiser-repl-superparen-character)
(delete-char -1)
- (insert-char ?\) (geiser-repl--nesting-level))))
+ (let ((level (geiser-repl--nesting-level)))
+ (if (memq nil (mapcar (lambda (idx)
+ (= (char-after idx) ?\)))
+ (number-sequence (point) (- (+ (point) level) 1))))
+ (insert-char ?\) level)
+ (forward-char level)))))
(defvar-local geiser-repl-superparen-mode-string " S"
"Modeline indicator for geiser-repl-superparen-mode")