Commits

Robert Lehmann committed 8390fb1

Closes #777: fix position in case of unexpected EOL.

Comments (0)

Files changed (1)

pygments/lexer.py

                 try:
                     if text[pos] == '\n':
                         # at EOL, reset state to "root"
-                        pos += 1
                         statestack = ['root']
                         statetokens = tokendefs['root']
                         yield pos, Text, u'\n'
+                        pos += 1
                         continue
                     yield pos, Error, text[pos]
                     pos += 1