Mercurial > kallithea
changeset 3151:58a4004224a2 beta
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
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 05 Jan 2013 03:30:24 +0100 |
parents | 80abc924a38c |
children | 46234d2d388f |
files | rhodecode/lib/vcs/nodes.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/vcs/nodes.py Sat Jan 05 02:40:21 2013 +0100 +++ b/rhodecode/lib/vcs/nodes.py Sat Jan 05 03:30:24 2013 +0100 @@ -362,10 +362,11 @@ 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