diff options
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-repl.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index 9e66901..b7401b9 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -336,11 +336,19 @@ module command as a string") (insert "\n") (lisp-indent-line))) +(defun geiser-repl--nesting-level () + (let ((begin (if comint-last-prompt-overlay + (overlay-end comint-last-prompt-overlay) + (save-excusion (geiser-repl--bol) (point))))) + (save-restriction + (narrow-to-region begin (point-max)) + (geiser-syntax--nesting-level)))) + (defun geiser-repl--send-input () (interactive) (let ((p (point))) (end-of-line) - (if (zerop (geiser-syntax--nesting-level)) + (if (<= (geiser-repl--nesting-level) 0) (comint-send-input) (goto-char p) (if geiser-repl-auto-indent-p |