summaryrefslogtreecommitdiff
path: root/pygments/lexer.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r--pygments/lexer.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py
index 28c5c825..51bacdbd 100644
--- a/pygments/lexer.py
+++ b/pygments/lexer.py
@@ -153,7 +153,8 @@ class DelegatingLexer(Lexer):
buffered += v
else:
lng_buffer.append((i, t, v))
- # the last "\n" should always be lexed by the root lexer
+ if lng_buffer:
+ insertions.append((len(buffered), lng_buffer))
return do_insertions(insertions,
self.root_lexer.get_tokens_unprocessed(buffered))