Class: Redwood::BufferListMode

Inherits:
LineCursorMode show all
Defined in:
lib/sup/modes/buffer_list_mode.rb

Instance Attribute Summary

Attributes inherited from LineCursorMode

#curpos

Attributes inherited from ScrollMode

#botline, #leftcol, #status, #topline

Attributes inherited from Mode

#buffer

Instance Method Summary collapse

Methods inherited from LineCursorMode

#cleanup, #draw

Methods inherited from ScrollMode

#at_bottom?, #at_top?, #cancel_search!, #col_jump, #col_left, #col_right, #continue_search_in_buffer, #draw, #ensure_mode_validity, #half_page_down, #half_page_up, #in_search?, #jump_to_col, #jump_to_end, #jump_to_left, #jump_to_line, #jump_to_start, #line_down, #line_up, #page_down, #page_up, #resize, #rightcol, #search_goto_line, #search_goto_pos, #search_in_buffer, #search_start_line

Methods inherited from Mode

#blur, #cancel_search!, #cleanup, #draw, #handle_input, #help_text, #in_search?, keymap, keymaps, #killable?, load_all_modes, make_name, #name, #pipe_to_process, register_keymap, #resize, #resolve_input, #save_to_file, #status, #unsaved?

Constructor Details

#initializeBufferListMode

Returns a new instance of BufferListMode.



10
11
12
13
# File 'lib/sup/modes/buffer_list_mode.rb', line 10

def initialize
  regen_text
  super
end

Instance Method Details

#[](i) ⇒ Object



16
# File 'lib/sup/modes/buffer_list_mode.rb', line 16

def [] i; @text[i] end

#focusObject



18
19
20
21
# File 'lib/sup/modes/buffer_list_mode.rb', line 18

def focus
  reload # buffers may have been killed or created since last view
  set_cursor_pos 0
end

#linesObject



15
# File 'lib/sup/modes/buffer_list_mode.rb', line 15

def lines; @text.length end