Class: GitSpelunk::UI::RepoWindow
- Defined in:
- lib/git_spelunk/ui/repo.rb
Instance Attribute Summary collapse
-
#command_buffer ⇒ Object
Returns the value of attribute command_buffer.
-
#command_mode ⇒ Object
Returns the value of attribute command_mode.
-
#content ⇒ Object
Returns the value of attribute content.
Instance Method Summary collapse
- #draw ⇒ Object
- #draw_status_line ⇒ Object
-
#initialize(height, offset) ⇒ RepoWindow
constructor
A new instance of RepoWindow.
Methods inherited from Window
#line_remainder, #with_highlighting
Constructor Details
#initialize(height, offset) ⇒ RepoWindow
4 5 6 7 8 9 |
# File 'lib/git_spelunk/ui/repo.rb', line 4 def initialize(height, offset) @window = Curses::Window.new(height, Curses.cols, offset, 0) @offset = offset @height = height @content = "" end |
Instance Attribute Details
#command_buffer ⇒ Object
Returns the value of attribute command_buffer.
11 12 13 |
# File 'lib/git_spelunk/ui/repo.rb', line 11 def command_buffer @command_buffer end |
#command_mode ⇒ Object
Returns the value of attribute command_mode.
11 12 13 |
# File 'lib/git_spelunk/ui/repo.rb', line 11 def command_mode @command_mode end |
#content ⇒ Object
Returns the value of attribute content.
11 12 13 |
# File 'lib/git_spelunk/ui/repo.rb', line 11 def content @content end |
Instance Method Details
#draw ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/git_spelunk/ui/repo.rb', line 13 def draw @window.setpos(0,0) draw_status_line @window.addstr(@content + "\n") if content @window.addstr("\n" * (@height - @content.split("\n").size - 2)) @window.refresh end |
#draw_status_line ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/git_spelunk/ui/repo.rb', line 21 def draw_status_line with_highlighting do @window.addstr("navigation: j k CTRL-D CTRL-U ") @window.addstr("history: [ ] ") @window.addstr("search: / ") @window.addstr(" " * line_remainder + "\n") end end |