diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index a1833a2579..bba1400e6e 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,7 +1,6 @@ - reader syntax for arrays, byte arrays, displaced aliens - out of memory error when printing global namespace - removing unneeded #label -- pprint trailing space regression - finish scrollbars - fix up the min thumb size hack diff --git a/library/syntax/prettyprint.factor b/library/syntax/prettyprint.factor index cc2b6b48ce..1cb55d880d 100644 --- a/library/syntax/prettyprint.factor +++ b/library/syntax/prettyprint.factor @@ -117,9 +117,12 @@ C: newline ( -- section ) M: newline pprint-section* ( newline -- ) section-start fresh-line ; +: advance ( section -- ) + section-start last-newline get = [ " " write ] unless ; + M: block pprint-section* ( block -- ) f swap block-sections [ - over [ " " write ] when pprint-section drop t + over [ dup advance ] when pprint-section drop t ] each drop ; : pprinter get pprinter-stack push ;