diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml index c9cb99e2..63539123 100644 --- a/app/views/commits/_text_file.html.haml +++ b/app/views/commits/_text_file.html.haml @@ -2,7 +2,7 @@ - line_new = 0 - lines_arr = diff.diff.lines.to_a - lines_arr.each do |line| - - encode(line) + - line = encode(line) - next if line.match(/^--- \/dev\/null/) - next if line.match(/^--- a/) - next if line.match(/^\+\+\+ b/) diff --git a/lib/utils.rb b/lib/utils.rb index 23f05f6f..d0339c2b 100644 --- a/lib/utils.rb +++ b/lib/utils.rb @@ -29,12 +29,12 @@ module Utils module Colorize include CharEncode def colorize - system_colorize(encode(data), name) + system_colorize(data, name) end def system_colorize(data, file_name) ft = handle_file_type(file_name) - Pygments.highlight(data, :lexer => ft, :options => { :encoding => 'utf-8', :linenos => 'True' }) + Pygments.highlight(encode(data), :lexer => ft, :options => { :encoding => 'utf-8', :linenos => 'True' }) end def handle_file_type(file_name, mime_type = nil)