--- ..\..\tidy_26_10_2004\src\streamio.h	2004-03-08 08:59:32.000000000 +0100
+++ streamio.h	2004-11-05 13:02:20.502436800 +0100
@@ -39,6 +39,7 @@
 ************************/
 
 #define CHARBUF_SIZE 5
+#define LASTCOL_SIZE 64
 
 /* non-raw input is cleaned up*/
 struct _StreamIn
@@ -49,7 +50,8 @@
     uint   bufpos;
     uint   bufsize;
     int    tabs;
-    int    lastcol;
+    int    lastcols[LASTCOL_SIZE];
+    int    curlastcol;
     int    curcol;
     int    curline;
     int    encoding;
     
-----------------------------------------------------------------------------     
     
--- ..\..\tidy_26_10_2004\src\streamio.c	2004-08-07 09:58:24.000000000 +0200
+++ streamio.c	2004-11-05 13:15:02.888694400 +0100
@@ -114,6 +114,7 @@
     in->doc = doc;
     in->bufsize = CHARBUF_SIZE;
     in->charbuf = MemAlloc(sizeof(tchar) * in->bufsize);
+    in->curlastcol = 0;
 #ifdef TIDY_STORE_ORIGINAL_TEXT
     in->otextbuf = NULL;
     in->otextlen = 0;
@@ -272,7 +273,13 @@
     if ( in->pushed )
         return PopChar( in );
 
-    in->lastcol = in->curcol;
+    // Rotating array storing the last 64 (LASTCOL_SIZE) lastcol
+    in->curlastcol++;
+    if( in->curlastcol>=LASTCOL_SIZE ) 
+    {
+        in->curlastcol-=LASTCOL_SIZE;
+    }
+    in->lastcols[in->curlastcol] = in->curcol;
 
     if ( in->tabs > 0 )
     {
@@ -478,6 +485,14 @@
             return c;
         }
         in->curcol++;
+
+        // Rotating array of lastcol
+        in->curlastcol++;
+        if( in->curlastcol>=LASTCOL_SIZE ) 
+        {
+          in->curlastcol-=LASTCOL_SIZE;
+        }
+
     }
     return c;
 }
@@ -500,7 +515,13 @@
     if (c == '\n')
         --(in->curline);
 
-    in->curcol = in->lastcol;
+    // Rotating array storing the last 64 (LASTCOL_SIZE) lastcol
+    in->curcol = in->lastcols[in->curlastcol];
+    in->curlastcol--;
+    if( in->curlastcol<0 ) 
+    {
+        in->curlastcol+=LASTCOL_SIZE;
+    }
 }
 
--- ..\..\tidy_26_10_2004\src\lexer.c	2004-08-12 09:58:06.000000000 +0200
+++ lexer.c	2004-11-05 14:24:43.099542400 +0100
@@ -2230,7 +2230,6 @@
                 {
                     UngetChar(c, doc->docIn);     /* push back letter */
                     UngetChar('<', doc->docIn);
-                    --(doc->docIn->curcol);
                     lexer->lexsize -= 2;      /* discard "<" + letter */
                     lexer->txtend = lexer->lexsize;
                     lexer->state = LEX_STARTTAG;         /* ready to read tag name */



