aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/lib/vcs/nodes.py
diff options
context:
space:
mode:
Diffstat (limited to 'rhodecode/lib/vcs/nodes.py')
-rw-r--r--rhodecode/lib/vcs/nodes.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/rhodecode/lib/vcs/nodes.py b/rhodecode/lib/vcs/nodes.py
index ca3add8a..bd5214db 100644
--- a/rhodecode/lib/vcs/nodes.py
+++ b/rhodecode/lib/vcs/nodes.py
@@ -362,10 +362,11 @@ class FileNode(Node):
Returns pygment's lexer class. Would try to guess lexer taking file's
content, name and mimetype.
"""
+
try:
- lexer = lexers.guess_lexer_for_filename(self.name, self.content)
+ lexer = lexers.guess_lexer_for_filename(self.name, self.content, stripnl=False)
except lexers.ClassNotFound:
- lexer = lexers.TextLexer()
+ lexer = lexers.TextLexer(stripnl=False)
# returns first alias
return lexer