Method: CodeTree.launch

Defined in:
lib/xiki/code_tree.rb

.launch(options = {}) ⇒ Object

Mapped to C-.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/xiki/code_tree.rb', line 14

def self.launch options={}
  line = Line.without_indent

  return Search.open_file_and_method line if Keys.open?   # If as+open, just navigato to it!

  FileTree.extra_line_if_end_of_file
  Tree.plus_to_minus_maybe
  orig = Location.new
  Line.to_left
  path = options[:path] || Tree.construct_path(:list=>true)
  path.each do |l|
    # if '- .xx:/", get rid of trailing slash
    l.sub!(/^([+-] .*\..+)\/$/, "\\1")
  end
  # Determine code to eval
  code = self.determine_code_from_path path
  orig.go

  self.run code, options
end