Class: CommandT::Finder::CommandFinder

Inherits:
CommandT::Finder show all
Defined in:
lib/command-t/finder/command_finder.rb

Instance Method Summary collapse

Methods inherited from CommandT::Finder

#path=, #sorted_matches_for

Constructor Details

#initialize(options = {}) ⇒ CommandFinder

Returns a new instance of CommandFinder.



7
8
9
10
# File 'lib/command-t/finder/command_finder.rb', line 7

def initialize(options = {})
  @scanner = Scanner::CommandScanner.new
  @matcher = Matcher.new @scanner, :always_show_dot_files => true
end

Instance Method Details

#flushObject



24
# File 'lib/command-t/finder/command_finder.rb', line 24

def flush; end

#nameObject



26
27
28
# File 'lib/command-t/finder/command_finder.rb', line 26

def name
  'Commands'
end

#open_selection(command, selection, options = {}) ⇒ Object



12
13
14
15
# File 'lib/command-t/finder/command_finder.rb', line 12

def open_selection(command, selection, options = {})
  escaped = VIM.escape_for_single_quotes selection
  ::VIM::command "call feedkeys(':#{selection} ', 'nt')"
end

#prepare_selection(selection) ⇒ Object



17
18
19
20
21
22
# File 'lib/command-t/finder/command_finder.rb', line 17

def prepare_selection(selection)
  # Pass selection through as-is, bypassing path-based stuff that the
  # controller would otherwise do, like `expand_path`,
  # `sanitize_path_string` and `relative_path_under_working_directory`.
  selection
end