Class: GitCrecord::Diff::PseudoLine

Inherits:
Difference show all
Defined in:
lib/git_crecord/diff/line.rb

Constant Summary

Constants inherited from Difference

Difference::REVERSE_SELECTED_MAP, Difference::SELECTED_MAP, Difference::SELECTION_MARKER_WIDTH

Instance Attribute Summary

Attributes inherited from Difference

#subs, #y1, #y2

Instance Method Summary collapse

Methods inherited from Difference

#content_width, #max_height, #prefix, #prefix_style, #print, #selectable_subs, #selected, #selected=, #strings

Constructor Details

#initialize(line) ⇒ PseudoLine

Returns a new instance of PseudoLine.



9
10
11
12
13
# File 'lib/git_crecord/diff/line.rb', line 9

def initialize(line)
  @line = line || 'file is empty'
  super()
  @selected = false
end

Instance Method Details

#expandedObject



27
28
29
# File 'lib/git_crecord/diff/line.rb', line 27

def expanded
  false
end

#generate_diffObject



31
32
33
# File 'lib/git_crecord/diff/line.rb', line 31

def generate_diff
  nil
end

#selectable?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/git_crecord/diff/line.rb', line 23

def selectable?
  false
end

#style(is_highlighted) ⇒ Object



35
36
37
# File 'lib/git_crecord/diff/line.rb', line 35

def style(is_highlighted)
  Curses::A_BOLD | (is_highlighted ? UI::Color.hl : UI::Color.normal)
end

#to_sObject



15
16
17
# File 'lib/git_crecord/diff/line.rb', line 15

def to_s
  @line
end

#x_offsetObject



19
20
21
# File 'lib/git_crecord/diff/line.rb', line 19

def x_offset
  6
end