branch: elpa/buttercup
commit 0868e7a9de594a5a4e77b6e25aa9291ed7711d74
Author: Ola Nilsson <[email protected]>
Commit: Ola Nilsson <[email protected]>

    Use buttercup--reporter-batch-preprint-spec-p to skip \r
    
    In buttercup-reporter-batch--print-spec-done-line, use
    buttercup--reporter-batch-preprint-spec-p to determine whether a
    carriage return (\r) should be used to overwrite the line or not.
    When buttercup--reporter-batch-preprint-spec-p returns non-nil,
    nothing have been printed so there is no need for a carriage
    return to "clear the line".
---
 buttercup.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 8925b4ac58..17f9cc8772 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1889,7 +1889,7 @@ EVENT and ARG are described in `buttercup-reporter'."
 (defun buttercup-reporter-batch--print-spec-done-line (spec color)
   "Print the remainder of the SPEC report line for `spec-done'.
 
-If COLOR is non-nil, erace the text so far on the current line
+If COLOR is non-nil, erase the text so far on the current line
 using '\\r' and replace it with the same text colored according to
 the SPEC status. Do not erase and replace if the text would have
 been reprinted with the default color.
@@ -1924,7 +1924,8 @@ Finally print the elapsed time for SPEC."
       ;; Carriage returns (\r) should not be colorized. It would mess
       ;; up color handling in Emacs compilation buffers using
       ;; `ansi-color-apply-on-region' in `compilation-filter-hook'.
-      (buttercup--print "\r%s"
+      (buttercup--print "%s%s"
+                        (if (buttercup--reporter-batch-preprint-spec-p spec) 
"\r" "")
                         (buttercup-colorize
                          (buttercup--indented-description spec) color)))
     (unless (eq 'passed status)

Reply via email to