aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/lib
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2013-01-05 03:30:24 +0100
committerMarcin Kuzminski <marcin@python-works.com>2013-01-05 03:30:24 +0100
commite53689f6c9326d317647fb8e5be9abbf3d817e9e (patch)
treed206f65383141cae03c7ec63b9aea8a4d4bc7198 /rhodecode/lib
parenta7b851cb0481daa9ade531daa07159d49e4b6bf0 (diff)
fixes issue #710 File view stripping empty lines from begininng and end of the file. Fixed by setting default Pygment lexer option to not do that
--HG-- branch : beta
Diffstat (limited to 'rhodecode/lib')
-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