Revert "Issue #133 - ever increasing indent!"

This reverts commit 0f80c08355.

This commit had other BAD consequences
This commit is contained in:
Geoff McLane 2015-02-12 14:56:51 +01:00
parent b14e3a3a1d
commit 5d2cbd10dc

View file

@ -652,27 +652,19 @@ static void PFlushLineImpl( TidyDocImpl* doc )
{ {
TidyPrintImpl* pprint = &doc->pprint; TidyPrintImpl* pprint = &doc->pprint;
uint i, j; uint i;
CheckWrapLine( doc ); CheckWrapLine( doc );
j = 0; /* Issue #133 - start text output */
if ( WantIndent(doc) ) if ( WantIndent(doc) )
{ {
uint spaces = GetSpaces( pprint ); uint spaces = GetSpaces( pprint );
for ( i = 0; i < spaces; ++i ) { for ( i = 0; i < spaces; ++i )
TY_(WriteChar)( ' ', doc->docOut ); 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++ ) for ( i = 0; i < pprint->linelen; ++i )
TY_(WriteChar)( pprint->linebuf[j], doc->docOut ); TY_(WriteChar)( pprint->linebuf[i], doc->docOut );
if ( IsInString(pprint) ) if ( IsInString(pprint) )
TY_(WriteChar)( '\\', doc->docOut ); TY_(WriteChar)( '\\', doc->docOut );