diff --git a/Check.hs b/Check.hs index f9be718..053f58c 100644 --- a/Check.hs +++ b/Check.hs @@ -78,13 +78,14 @@ ghcPackage = ExposePackage "ghc" ---------------------------------------------------------------- showErrMsg :: ErrMsg -> String -showErrMsg err = file ++ ":" ++ line ++ ":" ++ col ++ ":" ++ msg +showErrMsg err = file ++ ":" ++ line ++ ":" ++ col ++ ":" ++ msg ++ "\0" ++ ext where spn = head (errMsgSpans err) file = unpackFS (srcSpanFile spn) line = show (srcSpanStartLine spn) col = show (srcSpanStartCol spn) msg = showSDoc (errMsgShortDoc err) + ext = showSDoc (errMsgExtraInfo err) style :: PprStyle style = mkUserStyle neverQualify AllTheWay diff --git a/elisp/ghc-flymake.el b/elisp/ghc-flymake.el index e59ec86..bbd69d8 100644 --- a/elisp/ghc-flymake.el +++ b/elisp/ghc-flymake.el @@ -70,7 +70,11 @@ (defun ghc-flymake-insert-errors (title errs) (save-excursion (insert title "\n") - (mapc (lambda (x) (insert (ghc-replace-character x ghc-null ghc-newline) "\n")) errs))) + (mapc (lambda (x) (insert (ghc-replace-character x ghc-null ghc-newline) "\n")) errs) + (goto-char (point-min)) + (while (re-search-forward "In the [^:\n]+: " nil t) + (replace-match (concat "\n" (match-string 0) "\n "))))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;