gitlab-org--gitlab-foss/lib/gitlab/diff/line.rb
Rubén Dávila bb96d63153 New implementation for highlighting diff files. #3945
* It is more performant given now we process all the diff file instead
  of processing line by line.
* Multiline comments are highlighted correctly.
2015-12-30 00:52:50 -05:00

21 lines
424 B
Ruby

module Gitlab
module Diff
class Line
attr_reader :type, :text, :index, :old_pos, :new_pos
attr_accessor :highlighted_text
def initialize(text, type, index, old_pos, new_pos)
@text, @type, @index = text, type, index
@old_pos, @new_pos = old_pos, new_pos
end
def added?
type == 'new'
end
def removed?
type == 'old'
end
end
end
end