Skip to content

Commit 1e86061

Browse files
committed
Merge pull request #1163 from fice-t/repl
Make RET in REPL create new prompt with blank input
2 parents e54b254 + 9b730b2 commit 1e86061

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

haskell-repl.el

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@
2222

2323
(defun haskell-interactive-handle-expr ()
2424
"Handle an inputted expression at the REPL."
25-
(when (haskell-interactive-at-prompt)
26-
(let ((expr (haskell-interactive-mode-input)))
27-
(unless (string= "" (replace-regexp-in-string " " "" expr))
25+
(let ((expr (haskell-interactive-mode-input))
26+
(at-prompt-line (>= (line-end-position)
27+
haskell-interactive-mode-prompt-start)))
28+
(if (and at-prompt-line
29+
(string= "" (replace-regexp-in-string " " "" expr)))
30+
(progn
31+
(goto-char (point-max))
32+
(insert "\n")
33+
(haskell-interactive-mode-prompt))
34+
(when (haskell-interactive-at-prompt)
2835
(cond
2936
;; If already evaluating, then the user is trying to send
3037
;; input to the REPL during evaluation. Most likely in
@@ -37,7 +44,7 @@
3744
haskell-interactive-mode-result-end
3845
(point))))
3946
;; here we need to go to end of line again as evil-mode
40-
;; might hae managed to put us one char back
47+
;; might have managed to put us one char back
4148
(goto-char (point-max))
4249
(insert "\n")
4350
;; Bring the marker forward

0 commit comments

Comments
 (0)