Class: PWKeep::StatusBar
- Inherits:
-
Object
- Object
- PWKeep::StatusBar
- Defined in:
- lib/pwkeep/editor.rb
Instance Method Summary collapse
- #change_indicator ⇒ Object
-
#initialize(editor, options) ⇒ StatusBar
constructor
A new instance of StatusBar.
- #style_map ⇒ Object
- #view ⇒ Object
- #writable_indicator ⇒ Object
Constructor Details
#initialize(editor, options) ⇒ StatusBar
Returns a new instance of StatusBar.
422 423 424 425 |
# File 'lib/pwkeep/editor.rb', line 422 def initialize(editor, ) @editor = editor @options = end |
Instance Method Details
#change_indicator ⇒ Object
444 445 446 |
# File 'lib/pwkeep/editor.rb', line 444 def change_indicator @editor.modified? ? '*' : ' ' end |
#style_map ⇒ Object
440 441 442 |
# File 'lib/pwkeep/editor.rb', line 440 def style_map Dispel::StyleMap.single_line_reversed(@options[:columns]) end |
#view ⇒ Object
427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/pwkeep/editor.rb', line 427 def view columns = @options[:columns] version = "Ruco #{Ruco::VERSION} -- " position = " #{@editor.position.line + 1}:#{@editor.position.column + 1}" indicators = "#{change_indicator}#{writable_indicator}" essential = version + position + indicators space_left = [columns - essential.size, 0].max # fit file name into remaining space "#{version}#{indicators}#{' ' * space_left}#{position}"[0, columns] end |
#writable_indicator ⇒ Object
448 449 450 |
# File 'lib/pwkeep/editor.rb', line 448 def writable_indicator true end |