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 collapse

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, #strings

Constructor Details

#initialize(line) ⇒ PseudoLine

Returns a new instance of PseudoLine.



11
12
13
14
15
# File 'lib/git_crecord/diff/line.rb', line 11

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

Instance Attribute Details

#selectedObject

Returns the value of attribute selected.



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

def selected
  @selected
end

Instance Method Details

#expandedObject



29
30
31
# File 'lib/git_crecord/diff/line.rb', line 29

def expanded
  false
end

#generate_diffObject



33
34
35
# File 'lib/git_crecord/diff/line.rb', line 33

def generate_diff
  nil
end

#selectable?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/git_crecord/diff/line.rb', line 25

def selectable?
  true
end

#style(is_highlighted) ⇒ Object



37
38
39
# File 'lib/git_crecord/diff/line.rb', line 37

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

#to_sObject



17
18
19
# File 'lib/git_crecord/diff/line.rb', line 17

def to_s
  @line
end

#x_offsetObject



21
22
23
# File 'lib/git_crecord/diff/line.rb', line 21

def x_offset
  6
end