From 5d2cbd10dc1b56362553dac1e9188b74b5ea1e9e Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Thu, 12 Feb 2015 14:56:51 +0100 Subject: [PATCH] Revert "Issue #133 - ever increasing indent!" This reverts commit 0f80c083559265a99c24d1f7833fb4fafb0a84ab. This commit had other BAD consequences --- src/pprint.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/pprint.c b/src/pprint.c index cdbd257..ae6336a 100644 --- a/src/pprint.c +++ b/src/pprint.c @@ -652,27 +652,19 @@ static void PFlushLineImpl( TidyDocImpl* doc ) { TidyPrintImpl* pprint = &doc->pprint; - uint i, j; + uint i; CheckWrapLine( doc ); - j = 0; /* Issue #133 - start text output */ if ( WantIndent(doc) ) { uint spaces = GetSpaces( pprint ); - for ( i = 0; i < spaces; ++i ) { + for ( i = 0; i < spaces; ++i ) TY_(WriteChar)( ' ', doc->docOut ); - if (( j < pprint->linelen ) && ( pprint->linebuf[j] == ' ' )) { - /*\ Issue #133 - ever increasing indent on each tidy run - * Now removed any leading spaces by the amount of the indent - \*/ - j++; - } - } } - for ( ; j < pprint->linelen; j++ ) - TY_(WriteChar)( pprint->linebuf[j], doc->docOut ); + for ( i = 0; i < pprint->linelen; ++i ) + TY_(WriteChar)( pprint->linebuf[i], doc->docOut ); if ( IsInString(pprint) ) TY_(WriteChar)( '\\', doc->docOut );