command-t 1.6.1 → 1.7

Sign up to get free protection for your applications and to get access to all the features.
data/doc/tags ADDED
@@ -0,0 +1,57 @@
1
+ :CommandT command-t.txt /*:CommandT*
2
+ :CommandTBuffer command-t.txt /*:CommandTBuffer*
3
+ :CommandTFlush command-t.txt /*:CommandTFlush*
4
+ :CommandTJumps command-t.txt /*:CommandTJumps*
5
+ :CommandTTag command-t.txt /*:CommandTTag*
6
+ command-t command-t.txt /*command-t*
7
+ command-t-authors command-t.txt /*command-t-authors*
8
+ command-t-commands command-t.txt /*command-t-commands*
9
+ command-t-contents command-t.txt /*command-t-contents*
10
+ command-t-development command-t.txt /*command-t-development*
11
+ command-t-donations command-t.txt /*command-t-donations*
12
+ command-t-history command-t.txt /*command-t-history*
13
+ command-t-installation command-t.txt /*command-t-installation*
14
+ command-t-intro command-t.txt /*command-t-intro*
15
+ command-t-license command-t.txt /*command-t-license*
16
+ command-t-mappings command-t.txt /*command-t-mappings*
17
+ command-t-options command-t.txt /*command-t-options*
18
+ command-t-pathogen command-t.txt /*command-t-pathogen*
19
+ command-t-requirements command-t.txt /*command-t-requirements*
20
+ command-t-tips command-t.txt /*command-t-tips*
21
+ command-t-trouble-shooting command-t.txt /*command-t-trouble-shooting*
22
+ command-t-usage command-t.txt /*command-t-usage*
23
+ command-t-website command-t.txt /*command-t-website*
24
+ command-t-wildignore command-t.txt /*command-t-wildignore*
25
+ command-t.txt command-t.txt /*command-t.txt*
26
+ g:CommandTAcceptSelectionMap command-t.txt /*g:CommandTAcceptSelectionMap*
27
+ g:CommandTAcceptSelectionSplitMap command-t.txt /*g:CommandTAcceptSelectionSplitMap*
28
+ g:CommandTAcceptSelectionTabMap command-t.txt /*g:CommandTAcceptSelectionTabMap*
29
+ g:CommandTAcceptSelectionVSplitMap command-t.txt /*g:CommandTAcceptSelectionVSplitMap*
30
+ g:CommandTAlwaysShowDotFiles command-t.txt /*g:CommandTAlwaysShowDotFiles*
31
+ g:CommandTBackspaceMap command-t.txt /*g:CommandTBackspaceMap*
32
+ g:CommandTCancelMap command-t.txt /*g:CommandTCancelMap*
33
+ g:CommandTClearMap command-t.txt /*g:CommandTClearMap*
34
+ g:CommandTCursorEndMap command-t.txt /*g:CommandTCursorEndMap*
35
+ g:CommandTCursorLeftMap command-t.txt /*g:CommandTCursorLeftMap*
36
+ g:CommandTCursorRightMap command-t.txt /*g:CommandTCursorRightMap*
37
+ g:CommandTCursorStartMap command-t.txt /*g:CommandTCursorStartMap*
38
+ g:CommandTDeleteMap command-t.txt /*g:CommandTDeleteMap*
39
+ g:CommandTFileScanner command-t.txt /*g:CommandTFileScanner*
40
+ g:CommandTHighlightColor command-t.txt /*g:CommandTHighlightColor*
41
+ g:CommandTInputDebounce command-t.txt /*g:CommandTInputDebounce*
42
+ g:CommandTMatchWindowAtTop command-t.txt /*g:CommandTMatchWindowAtTop*
43
+ g:CommandTMatchWindowReverse command-t.txt /*g:CommandTMatchWindowReverse*
44
+ g:CommandTMaxCachedDirectories command-t.txt /*g:CommandTMaxCachedDirectories*
45
+ g:CommandTMaxDepth command-t.txt /*g:CommandTMaxDepth*
46
+ g:CommandTMaxFiles command-t.txt /*g:CommandTMaxFiles*
47
+ g:CommandTMaxHeight command-t.txt /*g:CommandTMaxHeight*
48
+ g:CommandTMinHeight command-t.txt /*g:CommandTMinHeight*
49
+ g:CommandTNeverShowDotFiles command-t.txt /*g:CommandTNeverShowDotFiles*
50
+ g:CommandTQuickfixMap command-t.txt /*g:CommandTQuickfixMap*
51
+ g:CommandTRefreshMap command-t.txt /*g:CommandTRefreshMap*
52
+ g:CommandTScanDotDirectories command-t.txt /*g:CommandTScanDotDirectories*
53
+ g:CommandTSelectNextMap command-t.txt /*g:CommandTSelectNextMap*
54
+ g:CommandTSelectPrevMap command-t.txt /*g:CommandTSelectPrevMap*
55
+ g:CommandTTagIncludeFilenames command-t.txt /*g:CommandTTagIncludeFilenames*
56
+ g:CommandTToggleFocusMap command-t.txt /*g:CommandTToggleFocusMap*
57
+ g:CommandTWildIgnore command-t.txt /*g:CommandTWildIgnore*
data/plugin/command-t.vim CHANGED
@@ -1,5 +1,5 @@
1
1
  " command-t.vim
2
- " Copyright 2010-2013 Wincent Colaiuta. All rights reserved.
2
+ " Copyright 2010-2014 Wincent Colaiuta. All rights reserved.
3
3
  "
4
4
  " Redistribution and use in source and binary forms, with or without
5
5
  " modification, are permitted provided that the following conditions are met:
@@ -92,6 +92,10 @@ if !has('ruby')
92
92
  finish
93
93
  endif
94
94
 
95
+ function CommandTListMatches()
96
+ ruby $command_t.list_matches
97
+ endfunction
98
+
95
99
  function CommandTHandleKey(arg)
96
100
  ruby $command_t.handle_key
97
101
  endfunction
@@ -11,12 +11,12 @@ ECHO = $(ECHO1:0=@echo)
11
11
  #### Start of system configuration section. ####
12
12
 
13
13
  srcdir = .
14
- topdir = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0
14
+ topdir = /Users/glh/.rbenv/versions/2.1.1/include/ruby-2.1.0
15
15
  hdrdir = $(topdir)
16
- arch_hdrdir = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin13
16
+ arch_hdrdir = /Users/glh/.rbenv/versions/2.1.1/include/ruby-2.1.0/x86_64-darwin13.0
17
17
  PATH_SEPARATOR = :
18
18
  VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
19
- prefix = /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
19
+ prefix = $(DESTDIR)/Users/glh/.rbenv/versions/2.1.1
20
20
  rubysitearchprefix = $(rubylibprefix)/$(sitearch)
21
21
  rubyarchprefix = $(rubylibprefix)/$(arch)
22
22
  rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
@@ -32,7 +32,7 @@ vendorlibdir = $(vendordir)/$(ruby_version)
32
32
  vendordir = $(rubylibprefix)/vendor_ruby
33
33
  sitearchdir = $(sitelibdir)/$(sitearch)
34
34
  sitelibdir = $(sitedir)/$(ruby_version)
35
- sitedir = $(DESTDIR)/Library/Ruby/Site
35
+ sitedir = $(rubylibprefix)/site_ruby
36
36
  rubyarchdir = $(rubylibdir)/$(arch)
37
37
  rubylibdir = $(rubylibprefix)/$(ruby_version)
38
38
  sitearchincludedir = $(includedir)/$(sitearch)
@@ -40,20 +40,20 @@ archincludedir = $(includedir)/$(arch)
40
40
  sitearchlibdir = $(libdir)/$(sitearch)
41
41
  archlibdir = $(libdir)/$(arch)
42
42
  ridir = $(datarootdir)/$(RI_BASE_NAME)
43
- mandir = $(DESTDIR)/usr/share/man
43
+ mandir = $(datarootdir)/man
44
44
  localedir = $(datarootdir)/locale
45
45
  libdir = $(exec_prefix)/lib
46
46
  psdir = $(docdir)
47
47
  pdfdir = $(docdir)
48
48
  dvidir = $(docdir)
49
49
  htmldir = $(docdir)
50
- infodir = $(DESTDIR)/usr/share/info
50
+ infodir = $(datarootdir)/info
51
51
  docdir = $(datarootdir)/doc/$(PACKAGE)
52
- oldincludedir = /usr/include
53
- includedir = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk$(prefix)/include
52
+ oldincludedir = $(DESTDIR)/usr/include
53
+ includedir = $(prefix)/include
54
54
  localstatedir = $(prefix)/var
55
55
  sharedstatedir = $(prefix)/com
56
- sysconfdir = $(DESTDIR)/Library/Ruby/Site
56
+ sysconfdir = $(prefix)/etc
57
57
  datadir = $(datarootdir)
58
58
  datarootdir = $(prefix)/share
59
59
  libexecdir = $(exec_prefix)/libexec
@@ -62,30 +62,30 @@ bindir = $(exec_prefix)/bin
62
62
  archdir = $(rubyarchdir)
63
63
 
64
64
 
65
- CC = xcrun clang
66
- CXX = xcrun clang++
67
- LIBRUBY = $(LIBRUBY_SO)
65
+ CC = gcc-4.2
66
+ CXX = g++
67
+ LIBRUBY = $(LIBRUBY_A)
68
68
  LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
69
- LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
70
- LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)
69
+ LIBRUBYARG_SHARED =
70
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation
71
71
  empty =
72
72
  OUTFLAG = -o $(empty)
73
73
  COUTFLAG = -o $(empty)
74
74
 
75
75
  RUBY_EXTCONF_H =
76
76
  cflags = $(optflags) $(debugflags) $(warnflags)
77
- optflags =
78
- debugflags = -g
79
- warnflags =
80
- CCDLFLAGS =
81
- CFLAGS = $(CCDLFLAGS) -g -Os -pipe $(ARCH_FLAG)
77
+ optflags = -O3 -fno-fast-math
78
+ debugflags = -ggdb3
79
+ warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wextra-tokens
80
+ CCDLFLAGS = -fno-common
81
+ CFLAGS = $(CCDLFLAGS) -O3 -Wno-error=shorten-64-to-32 -pipe $(ARCH_FLAG)
82
82
  INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
83
83
  DEFS =
84
- CPPFLAGS = -DHAVE_PTHREAD_H -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
85
- CXXFLAGS = $(CCDLFLAGS) -g -Os -pipe $(ARCH_FLAG)
86
- ldflags = -L. -L/usr/local/lib
87
- dldflags = -undefineddynamic_lookup -multiply_definedsuppress
88
- ARCH_FLAG =
84
+ CPPFLAGS = -I/Users/glh/.rbenv/versions/2.1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
85
+ CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
86
+ ldflags = -L. -L/Users/glh/.rbenv/versions/2.1.1/lib -fstack-protector
87
+ dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress
88
+ ARCH_FLAG =
89
89
  DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
90
90
  LDSHARED = $(CC) -dynamic -bundle
91
91
  LDSHAREDXX = $(CXX) -dynamic -bundle
@@ -93,18 +93,18 @@ AR = ar
93
93
  EXEEXT =
94
94
 
95
95
  RUBY_INSTALL_NAME = ruby
96
- RUBY_SO_NAME = ruby.2.0.0
96
+ RUBY_SO_NAME = ruby
97
97
  RUBYW_INSTALL_NAME =
98
98
  RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
99
99
  RUBYW_BASE_NAME = rubyw
100
100
  RUBY_BASE_NAME = ruby
101
101
 
102
- arch = universal-darwin13
102
+ arch = x86_64-darwin13.0
103
103
  sitearch = $(arch)
104
- ruby_version = 2.0.0
104
+ ruby_version = 2.1.0
105
105
  ruby = $(bindir)/ruby
106
106
  RUBY = $(ruby)
107
- ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h
107
+ ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
108
108
 
109
109
  RM = rm -f
110
110
  RM_RF = $(RUBY) -run -e rm -- -rf
@@ -132,7 +132,7 @@ extout =
132
132
  extout_prefix =
133
133
  target_prefix =
134
134
  LOCAL_LIBS =
135
- LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl -lobjc
135
+ LIBS = -lpthread -ldl -lobjc
136
136
  ORIG_SRCS = ext.c match.c matcher.c
137
137
  SRCS = $(ORIG_SRCS)
138
138
  OBJS = ext.o match.o matcher.o
@@ -144,12 +144,13 @@ DLLIB = $(TARGET).bundle
144
144
  EXTSTATIC =
145
145
  STATIC_LIB =
146
146
 
147
- BINDIR = $(DESTDIR)$(bindir)
148
- RUBYCOMMONDIR = $(DESTDIR)$(sitedir)$(target_prefix)
149
- RUBYLIBDIR = $(DESTDIR)$(sitelibdir)$(target_prefix)
150
- RUBYARCHDIR = $(DESTDIR)$(sitearchdir)$(target_prefix)
151
- HDRDIR = $(DESTDIR)$(rubyhdrdir)/ruby$(target_prefix)
152
- ARCHHDRDIR = $(DESTDIR)$(rubyhdrdir)/$(arch)/ruby$(target_prefix)
147
+ TIMESTAMP_DIR = .
148
+ BINDIR = $(bindir)
149
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
150
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
151
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
152
+ HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
153
+ ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
153
154
 
154
155
  TARGET_SO = $(DLLIB)
155
156
  CLEANLIBS = $(TARGET).bundle
@@ -179,7 +180,7 @@ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
179
180
  realclean: distclean
180
181
  install: install-so install-rb
181
182
 
182
- install-so: $(DLLIB) ./.RUBYARCHDIR.time
183
+ install-so: $(DLLIB) $(TIMESTAMP_DIR)/.RUBYARCHDIR.time
183
184
  $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
184
185
  clean-static::
185
186
  -$(Q)$(RM) $(STATIC_LIB)
@@ -189,8 +190,8 @@ pre-install-rb: Makefile
189
190
  pre-install-rb-default: Makefile
190
191
  pre-install-rb-default:
191
192
  $(ECHO) installing default ext libraries
192
- ./.RUBYARCHDIR.time:
193
- $(Q) $(MAKEDIRS) $(RUBYARCHDIR)
193
+ $(TIMESTAMP_DIR)/.RUBYARCHDIR.time:
194
+ $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
194
195
  $(Q) $(TOUCH) $@
195
196
 
196
197
  site-install: site-install-so site-install-rb
@@ -231,7 +232,7 @@ $(DLLIB): $(OBJS) Makefile
231
232
  $(ECHO) linking shared-object $(DLLIB)
232
233
  -$(Q)$(RM) $(@)
233
234
  $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
234
- $(Q) test -z '$(RUBY_CODESIGN)' || codesign -s '$(RUBY_CODESIGN)' -f $@
235
+ $(Q) $(POSTLINK)
235
236
 
236
237
 
237
238
 
@@ -1,4 +1,4 @@
1
- # Copyright 2010-2013 Wincent Colaiuta. All rights reserved.
1
+ # Copyright 2010-2014 Wincent Colaiuta. All rights reserved.
2
2
  #
3
3
  # Redistribution and use in source and binary forms, with or without
4
4
  # modification, are permitted provided that the following conditions are met:
@@ -95,7 +95,7 @@ module CommandT
95
95
  def refresh
96
96
  return unless @active_finder && @active_finder.respond_to?(:flush)
97
97
  @active_finder.flush
98
- list_matches
98
+ list_matches!
99
99
  end
100
100
 
101
101
  def flush
@@ -109,7 +109,7 @@ module CommandT
109
109
  key = ::VIM::evaluate('a:arg').to_i.chr
110
110
  if @focus == @prompt
111
111
  @prompt.add! key
112
- list_matches
112
+ @needs_update = true
113
113
  else
114
114
  @match_window.find key
115
115
  end
@@ -118,14 +118,14 @@ module CommandT
118
118
  def backspace
119
119
  if @focus == @prompt
120
120
  @prompt.backspace!
121
- list_matches
121
+ @needs_update = true
122
122
  end
123
123
  end
124
124
 
125
125
  def delete
126
126
  if @focus == @prompt
127
127
  @prompt.delete!
128
- list_matches
128
+ @needs_update = true
129
129
  end
130
130
  end
131
131
 
@@ -155,7 +155,7 @@ module CommandT
155
155
 
156
156
  def clear
157
157
  @prompt.clear!
158
- list_matches
158
+ list_matches!
159
159
  end
160
160
 
161
161
  def cursor_left
@@ -182,8 +182,25 @@ module CommandT
182
182
  @match_window.unload
183
183
  end
184
184
 
185
+ def list_matches(options = {})
186
+ return unless @needs_update || options[:force]
187
+
188
+ @matches = @active_finder.sorted_matches_for(
189
+ @prompt.abbrev,
190
+ :limit => match_limit,
191
+ :threads => CommandT::Util.processor_count
192
+ )
193
+ @match_window.matches = @matches
194
+
195
+ @needs_update = false
196
+ end
197
+
185
198
  private
186
199
 
200
+ def list_matches!
201
+ list_matches(:force => true)
202
+ end
203
+
187
204
  def show
188
205
  @initial_window = $curwin
189
206
  @initial_buffer = $curbuf
@@ -192,34 +209,36 @@ module CommandT
192
209
  :match_window_at_top => get_bool('g:CommandTMatchWindowAtTop'),
193
210
  :match_window_reverse => get_bool('g:CommandTMatchWindowReverse'),
194
211
  :min_height => min_height,
212
+ :debounce_interval => get_number('g:CommandTInputDebounce', 50),
195
213
  :prompt => @prompt
196
214
  @focus = @prompt
197
215
  @prompt.focus
198
216
  register_for_key_presses
217
+ set_up_autocmds
199
218
  clear # clears prompt and lists matches
200
219
  end
201
220
 
202
221
  def max_height
203
- @max_height ||= get_number('g:CommandTMaxHeight') || 0
222
+ @max_height ||= get_number('g:CommandTMaxHeight', 0)
204
223
  end
205
224
 
206
225
  def min_height
207
226
  @min_height ||= begin
208
- min_height = get_number('g:CommandTMinHeight') || 0
227
+ min_height = get_number('g:CommandTMinHeight', 0)
209
228
  min_height = max_height if max_height != 0 && min_height > max_height
210
229
  min_height
211
230
  end
212
231
  end
213
232
 
214
- def get_number name
215
- VIM::exists?(name) ? ::VIM::evaluate("#{name}").to_i : nil
233
+ def get_number(name, default = nil)
234
+ VIM::exists?(name) ? ::VIM::evaluate("#{name}").to_i : default
216
235
  end
217
236
 
218
- def get_bool name
237
+ def get_bool(name)
219
238
  VIM::exists?(name) ? ::VIM::evaluate("#{name}").to_i != 0 : nil
220
239
  end
221
240
 
222
- def get_string name
241
+ def get_string(name)
223
242
  VIM::exists?(name) ? ::VIM::evaluate("#{name}").to_s : nil
224
243
  end
225
244
 
@@ -333,6 +352,13 @@ module CommandT
333
352
  end
334
353
  end
335
354
 
355
+ def set_up_autocmds
356
+ ::VIM::command 'augroup Command-T'
357
+ ::VIM::command 'au!'
358
+ ::VIM::command 'autocmd CursorHold <buffer> :call CommandTListMatches()'
359
+ ::VIM::command 'augroup END'
360
+ end
361
+
336
362
  # Returns the desired maximum number of matches, based on available
337
363
  # vertical space and the g:CommandTMaxHeight option.
338
364
  def match_limit
@@ -342,15 +368,6 @@ module CommandT
342
368
  limit
343
369
  end
344
370
 
345
- def list_matches
346
- @matches = @active_finder.sorted_matches_for(
347
- @prompt.abbrev,
348
- :limit => match_limit,
349
- :threads => CommandT::Util.processor_count
350
- )
351
- @match_window.matches = @matches
352
- end
353
-
354
371
  def buffer_finder
355
372
  @buffer_finder ||= CommandT::BufferFinder.new
356
373
  end
@@ -363,7 +380,8 @@ module CommandT
363
380
  :always_show_dot_files => get_bool('g:CommandTAlwaysShowDotFiles'),
364
381
  :never_show_dot_files => get_bool('g:CommandTNeverShowDotFiles'),
365
382
  :scan_dot_directories => get_bool('g:CommandTScanDotDirectories'),
366
- :wild_ignore => get_string('g:CommandTWildIgnore')
383
+ :wild_ignore => get_string('g:CommandTWildIgnore'),
384
+ :scanner => get_string('g:CommandTFileScanner')
367
385
  end
368
386
 
369
387
  def jump_finder
Binary file
@@ -1,4 +1,4 @@
1
- # Copyright 2010-2013 Wincent Colaiuta. All rights reserved.
1
+ # Copyright 2010-2014 Wincent Colaiuta. All rights reserved.
2
2
  #
3
3
  # Redistribution and use in source and binary forms, with or without
4
4
  # modification, are permitted provided that the following conditions are met:
@@ -36,8 +36,10 @@ header('ruby.h')
36
36
  header('stdlib.h')
37
37
  header('string.h')
38
38
 
39
- # optional headers
40
- have_header('pthread.h') # sets HAVE_PTHREAD_H if found
39
+ # optional
40
+ if RbConfig::CONFIG['THREAD_MODEL'] == 'pthread'
41
+ have_library('pthread', 'pthread_create') # sets HAVE_PTHREAD_H if found
42
+ end
41
43
 
42
44
  RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
43
45
 
@@ -1,4 +1,4 @@
1
- # Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
1
+ # Copyright 2010-2014 Wincent Colaiuta. All rights reserved.
2
2
  #
3
3
  # Redistribution and use in source and binary forms, with or without
4
4
  # modification, are permitted provided that the following conditions are met:
@@ -23,12 +23,24 @@
23
23
 
24
24
  require 'command-t/ext' # CommandT::Matcher
25
25
  require 'command-t/finder'
26
- require 'command-t/scanner/file_scanner'
26
+ require 'command-t/scanner/file_scanner/ruby_file_scanner'
27
+ require 'command-t/scanner/file_scanner/find_file_scanner'
28
+ require 'command-t/scanner/file_scanner/watchman_file_scanner'
27
29
 
28
30
  module CommandT
29
31
  class FileFinder < Finder
30
- def initialize path = Dir.pwd, options = {}
31
- @scanner = FileScanner.new path, options
32
+ def initialize(path = Dir.pwd, options = {})
33
+ case options.delete(:scanner)
34
+ when 'ruby', nil # ruby is the default
35
+ @scanner = FileScanner::RubyFileScanner.new(path, options)
36
+ when 'find'
37
+ @scanner = FileScanner::FindFileScanner.new(path, options)
38
+ when 'watchman'
39
+ @scanner = FileScanner::WatchmanFileScanner.new(path, options)
40
+ else
41
+ raise ArgumentError, "unknown scanner type '#{options[:scanner]}'"
42
+ end
43
+
32
44
  @matcher = Matcher.new @scanner, options
33
45
  end
34
46
 
@@ -36,4 +48,4 @@ module CommandT
36
48
  @scanner.flush
37
49
  end
38
50
  end # class FileFinder
39
- end # CommandT
51
+ end # module CommandT