# HG changeset patch # User Matt Mackall # Date 2013-05-09 23:34:04 # Node ID 12459bfa4b591f173059305e93bc3bab7b4ba704 # Parent 4327687ca7579e825b8877d9756b91c066c743d5 # Parent bcdfb6078b9f5bd34982ef8e2287c3837c033d92 merge with stable diff --git a/hgext/highlight/highlight.py b/hgext/highlight/highlight.py --- a/hgext/highlight/highlight.py +++ b/hgext/highlight/highlight.py @@ -38,12 +38,13 @@ def pygmentize(field, fctx, style, tmpl) # To get multi-line strings right, we can't format line-by-line try: - lexer = guess_lexer_for_filename(fctx.path(), text[:1024]) + lexer = guess_lexer_for_filename(fctx.path(), text[:1024], + stripnl=False) except (ClassNotFound, ValueError): try: - lexer = guess_lexer(text[:1024]) + lexer = guess_lexer(text[:1024], stripnl=False) except (ClassNotFound, ValueError): - lexer = TextLexer() + lexer = TextLexer(stripnl=False) formatter = HtmlFormatter(style=style)