Class: VER::Executor::ExBuffer

Inherits:
Entry show all
Defined in:
lib/ver/executor/buffer.rb

Constant Summary

Constants inherited from VER::Entry

VER::Entry::BACKWARD_WORD, VER::Entry::FORWARD_WORD

Instance Attribute Summary

Attributes inherited from Entry

#callback, #caller, #parent, #tabcount, #tree, #update_on_change, #ybar

Attributes included from Keymapped

#major_mode

Instance Method Summary collapse

Methods inherited from Entry

#accept_line, #after_update, #cancel, #completed=, #completion, #destroy, #initialize, #next_line, #on_delete, #on_insert, #prev_line, #speed_selection, #subset, #sync_value_with_tree_selection, #tree_selection_value, #update_items, #update_only

Methods included from Keymapped

#minor_mode, #minor_mode?

Methods inherited from VER::Entry

#accept_line, #beginning_of_history, #cursor=, #delete, #delete_next_char, #delete_next_word, #delete_prev_char, #delete_prev_word, #deleting, #end_of_history, #end_of_line, #error, #event, #events, #insert, #insert_selection, #insert_string, #insert_tab, #kill, #kill_end_of_line, #killing, #message, #next_char, #next_history, #next_word, #paste, #prev_char, #prev_word, #previous_history, #sel_end_of_line, #sel_next_char, #sel_next_word, #sel_prev_char, #sel_prev_word, #sel_start_of_line, #start_of_line, #style, #transpose_chars, #value=, #virtual_movement

Constructor Details

This class inherits a constructor from VER::Executor::Entry

Instance Method Details

#action(selected) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/ver/executor/buffer.rb', line 21

def action(selected)
  item = tree.focus_item
  key, name, = item.options(:values)
  return unless key
  uri = Marshal.load(key)
  Buffer[uri].show
  callback.destroy(false)
end

#choices(name) ⇒ Object



17
18
19
# File 'lib/ver/executor/buffer.rb', line 17

def choices(name)
  subset(name, @buffers)
end

#setupObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/ver/executor/buffer.rb', line 4

def setup
  callback.update_on_change = true
  @buffers = VER.buffers.map{|buffer|
    [Marshal.dump(buffer.uri), buffer.uri.to_s]
  }

  tree.configure(
    show:           [],
    columns:        %w[name file],
    displaycolumns: %w[file]
  )
end