Open eriksvedang opened 4 years ago
One hint is that the colorizing of the output string might mess it up...
One more hint is this function:
(defun inf-carp-remove-subprompts (string)
"Remove subprompts from STRING."
(replace-regexp-in-string inf-carp-subprompt "" string))
If it is defined like this instead (replacing inf-carp-subprompt
with a string literal) it works:
(defun inf-carp-remove-subprompts (string)
"Remove subprompts from STRING."
(replace-regexp-in-string " " "" string))
@adityaathalye I think you also experienced this issue, is that correct?
@hellerve yes, if I eval buffer (C-c C-l
), then the REPL prints appears to print one prompt per expression.
When using the Carp repl via emacs mode, the "sub prompt" (which currently is five spaces, defined in Repl.hs, line 130) is echoed leading to buggy/messy output, like this:
The alignment issue comes from evaluating a form with line breaks, which activates the sub prompt (printing a bunch of spaces). The idea behind the sub prompt in a normal repl (in the terminal) is to let the user enter multi line expressions in a nice looking way.
In
inf-carp-mode.el
(in theemacs
dir of the Carp repo) there are two variables with regexps that are supposed to match and remove these spaces:But for some reason they don't work. If any emacs expert has the time to look into this it would be great!