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
16 changes: 9 additions & 7 deletions haskell-interactive-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,15 @@ SESSION, otherwise operate on the current buffer.

(defun haskell-mode-message-line (str)
"Message only one line, multiple lines just disturbs the programmer."
(let ((lines (split-string str "\n" t)))
(when (and (car lines) (stringp (car lines)))
(message "%s"
(concat (car lines)
(if (and (cdr lines) (stringp (cadr lines)))
(format " [ %s .. ]" (haskell-string-take (haskell-string-trim (cadr lines)) 10))
""))))))
(message (haskell-mode-one-line str (frame-width))))

(defun haskell-mode-one-line (str width)
"Try to fit as much as possible on one line."
(let*
((long-line (replace-regexp-in-string "\n" " " str))
(condensed (replace-regexp-in-string " +" " "
(haskell-string-trim long-line))))
(truncate-string-to-width condensed width nil nil "…")))

(defun haskell-interactive-mode-tab ()
"Do completion if at prompt or else try collapse/expand."
Expand Down