Class: GitSpelunk::UI::StatusWindow
- Inherits:
-
Object
- Object
- GitSpelunk::UI::StatusWindow
- Defined in:
- lib/git_spelunk/ui/status.rb
Instance Attribute Summary collapse
-
#command_buffer ⇒ Object
Returns the value of attribute command_buffer.
-
#status_message ⇒ Object
Returns the value of attribute status_message.
Instance Method Summary collapse
- #clear_onetime_message! ⇒ Object
- #draw ⇒ Object
- #exit_command_mode! ⇒ Object
-
#initialize ⇒ StatusWindow
constructor
A new instance of StatusWindow.
- #set_onetime_message(message) ⇒ Object
Constructor Details
#initialize ⇒ StatusWindow
Returns a new instance of StatusWindow.
4 5 6 7 8 |
# File 'lib/git_spelunk/ui/status.rb', line 4 def initialize @command_buffer = "" @status_message = "" @onetime_message = nil end |
Instance Attribute Details
#command_buffer ⇒ Object
Returns the value of attribute command_buffer.
10 11 12 |
# File 'lib/git_spelunk/ui/status.rb', line 10 def command_buffer @command_buffer end |
#status_message ⇒ Object
Returns the value of attribute status_message.
10 11 12 |
# File 'lib/git_spelunk/ui/status.rb', line 10 def @status_message end |
Instance Method Details
#clear_onetime_message! ⇒ Object
12 13 14 |
# File 'lib/git_spelunk/ui/status.rb', line 12 def @onetime_message = nil end |
#draw ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/git_spelunk/ui/status.rb', line 24 def draw styles = Dispel::StyleMap.new(1) view = if command_buffer.size > 0 ":" + command_buffer else = (@onetime_message || @status_message) styles.add(:reverse, 0, 0...999) end [view, styles] end |
#exit_command_mode! ⇒ Object
20 21 22 |
# File 'lib/git_spelunk/ui/status.rb', line 20 def exit_command_mode! self.command_buffer = "" end |
#set_onetime_message(message) ⇒ Object
16 17 18 |
# File 'lib/git_spelunk/ui/status.rb', line 16 def () @onetime_message = end |