format: fix addition of fill style newlines in ~< ... ~:@> directive

Only add fill style newline for blanks that don't follow a ~ newline
directive (see the format.logical-block.23 test in the ansi-test
suite).
This commit is contained in:
Marius Gerbershagen 2019-08-19 18:01:26 +02:00
parent df339485eb
commit c38739f3bb

View file

@ -2628,19 +2628,23 @@
insides
suffix)))
(defun add-fill-style-newlines (list string offset)
(defun add-fill-style-newlines (list string offset &optional previous-directive-is-newline)
(declare (si::c-local))
(if list
(let ((directive (car list)))
(if (simple-string-p directive)
(if (and (simple-string-p directive)
(not previous-directive-is-newline))
(nconc (add-fill-style-newlines-aux directive string offset)
(add-fill-style-newlines (cdr list)
string
(+ offset (length directive))))
(+ offset (length directive))
nil))
(cons directive
(add-fill-style-newlines (cdr list)
string
(format-directive-end directive)))))
(format-directive-end directive)
(char= (format-directive-character directive)
#\newline)))))
nil))
(defun add-fill-style-newlines-aux (literal string offset)