changeset 19179:12459bfa4b59

merge with stable
author Matt Mackall <mpm@selenic.com>
date Thu, 09 May 2013 18:34:04 -0500
parents 4327687ca757 (current diff) bcdfb6078b9f (diff)
children 8c2fdf7d5645
files
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/highlight/highlight.py	Wed May 01 10:44:21 2013 -0700
+++ b/hgext/highlight/highlight.py	Thu May 09 18:34:04 2013 -0500
@@ -38,12 +38,13 @@
 
     # 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)