Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions haskell-repl.el
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@

(defun haskell-interactive-handle-expr ()
"Handle an inputted expression at the REPL."
(when (haskell-interactive-at-prompt)
(let ((expr (haskell-interactive-mode-input)))
(unless (string= "" (replace-regexp-in-string " " "" expr))
(let ((expr (haskell-interactive-mode-input))
(at-prompt-line (>= (line-end-position)
haskell-interactive-mode-prompt-start)))
(if (and at-prompt-line
(string= "" (replace-regexp-in-string " " "" expr)))
(progn
(goto-char (point-max))
(insert "\n")
(haskell-interactive-mode-prompt))
(when (haskell-interactive-at-prompt)
(cond
;; If already evaluating, then the user is trying to send
;; input to the REPL during evaluation. Most likely in
Expand All @@ -37,7 +44,7 @@
haskell-interactive-mode-result-end
(point))))
;; here we need to go to end of line again as evil-mode
;; might hae managed to put us one char back
;; might have managed to put us one char back
(goto-char (point-max))
(insert "\n")
;; Bring the marker forward
Expand Down