From 1d168352f9fb8554b8290a5ea1101bf4bd5b2447 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 1 Sep 2005 06:01:51 +0000 Subject: [PATCH] prettyprinter regression fix --- TODO.FACTOR.txt | 1 - library/syntax/prettyprint.factor | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 ;