command-t 1.11.4 → 1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.txt +128 -39
- data/Rakefile +2 -18
- data/doc/command-t.txt +128 -39
- data/doc/tags +6 -1
- data/plugin/command-t.vim +7 -10
- data/ruby/command-t.rb +17 -0
- data/ruby/command-t/Makefile +8 -8
- data/ruby/command-t/controller.rb +89 -22
- data/ruby/command-t/ext.bundle +0 -0
- data/ruby/command-t/finder.rb +8 -2
- data/ruby/command-t/finder/buffer_finder.rb +8 -10
- data/ruby/command-t/finder/file_finder.rb +22 -27
- data/ruby/command-t/finder/jump_finder.rb +8 -10
- data/ruby/command-t/finder/mru_buffer_finder.rb +20 -22
- data/ruby/command-t/finder/tag_finder.rb +18 -20
- data/ruby/command-t/match_window.rb +30 -13
- data/ruby/command-t/path_utilities.rb +17 -0
- data/ruby/command-t/prompt.rb +1 -1
- data/ruby/command-t/scanner.rb +7 -3
- data/ruby/command-t/scanner/buffer_scanner.rb +14 -15
- data/ruby/command-t/scanner/file_scanner.rb +75 -66
- data/ruby/command-t/scanner/file_scanner/file_limit_exceeded.rb +10 -0
- data/ruby/command-t/scanner/file_scanner/find_file_scanner.rb +38 -38
- data/ruby/command-t/scanner/file_scanner/git_file_scanner.rb +46 -26
- data/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb +43 -43
- data/ruby/command-t/scanner/file_scanner/watchman_file_scanner.rb +46 -46
- data/ruby/command-t/scanner/jump_scanner.rb +22 -23
- data/ruby/command-t/scanner/mru_buffer_scanner.rb +20 -21
- data/ruby/command-t/scanner/tag_scanner.rb +23 -23
- data/ruby/command-t/scm_utilities.rb +22 -0
- data/ruby/command-t/settings.rb +0 -2
- data/ruby/command-t/util.rb +1 -1
- data/ruby/command-t/vim.rb +3 -3
- data/ruby/command-t/watchman.c +0 -15
- metadata +6 -3
- data/ruby/command-t/vim/path_utilities.rb +0 -34
@@ -1,15 +1,13 @@
|
|
1
1
|
# Copyright 2010-2014 Greg Hurrell. All rights reserved.
|
2
2
|
# Licensed under the terms of the BSD 2-clause license.
|
3
3
|
|
4
|
-
require 'command-t/ext' # CommandT::Matcher
|
5
|
-
require 'command-t/scanner/buffer_scanner'
|
6
|
-
require 'command-t/finder'
|
7
|
-
|
8
4
|
module CommandT
|
9
|
-
class
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
class Finder
|
6
|
+
class BufferFinder < Finder
|
7
|
+
def initialize
|
8
|
+
@scanner = Scanner::BufferScanner.new
|
9
|
+
@matcher = Matcher.new @scanner, :always_show_dot_files => true
|
10
|
+
end
|
11
|
+
end # class BufferFinder
|
12
|
+
end # class Finder
|
15
13
|
end # CommandT
|
@@ -1,34 +1,29 @@
|
|
1
1
|
# Copyright 2010-2014 Greg Hurrell. All rights reserved.
|
2
2
|
# Licensed under the terms of the BSD 2-clause license.
|
3
3
|
|
4
|
-
require 'command-t/ext' # CommandT::Matcher
|
5
|
-
require 'command-t/finder'
|
6
|
-
require 'command-t/scanner/file_scanner/ruby_file_scanner'
|
7
|
-
require 'command-t/scanner/file_scanner/find_file_scanner'
|
8
|
-
require 'command-t/scanner/file_scanner/watchman_file_scanner'
|
9
|
-
require 'command-t/scanner/file_scanner/git_file_scanner'
|
10
|
-
|
11
4
|
module CommandT
|
12
|
-
class
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
5
|
+
class Finder
|
6
|
+
class FileFinder < Finder
|
7
|
+
def initialize(path = Dir.pwd, options = {})
|
8
|
+
case options.delete(:scanner)
|
9
|
+
when 'ruby', nil # ruby is the default
|
10
|
+
@scanner = Scanner::FileScanner::RubyFileScanner.new(path, options)
|
11
|
+
when 'find'
|
12
|
+
@scanner = Scanner::FileScanner::FindFileScanner.new(path, options)
|
13
|
+
when 'watchman'
|
14
|
+
@scanner = Scanner::FileScanner::WatchmanFileScanner.new(path, options)
|
15
|
+
when 'git'
|
16
|
+
@scanner = Scanner::FileScanner::GitFileScanner.new(path, options)
|
17
|
+
else
|
18
|
+
raise ArgumentError, "unknown scanner type '#{options[:scanner]}'"
|
19
|
+
end
|
26
20
|
|
27
|
-
|
28
|
-
|
21
|
+
@matcher = Matcher.new @scanner, options
|
22
|
+
end
|
29
23
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
24
|
+
def flush
|
25
|
+
@scanner.flush
|
26
|
+
end
|
27
|
+
end # class FileFinder
|
28
|
+
end # class Finder
|
34
29
|
end # module CommandT
|
@@ -1,15 +1,13 @@
|
|
1
1
|
# Copyright 2011-2014 Greg Hurrell. All rights reserved.
|
2
2
|
# Licensed under the terms of the BSD 2-clause license.
|
3
3
|
|
4
|
-
require 'command-t/ext' # CommandT::Matcher
|
5
|
-
require 'command-t/scanner/jump_scanner'
|
6
|
-
require 'command-t/finder'
|
7
|
-
|
8
4
|
module CommandT
|
9
|
-
class
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
class Finder
|
6
|
+
class JumpFinder < Finder
|
7
|
+
def initialize
|
8
|
+
@scanner = Scanner::JumpScanner.new
|
9
|
+
@matcher = Matcher.new @scanner, :always_show_dot_files => true
|
10
|
+
end
|
11
|
+
end # class JumpFinder
|
12
|
+
end # class Finder
|
15
13
|
end # module CommandT
|
@@ -1,30 +1,28 @@
|
|
1
1
|
# Copyright 2014 Greg Hurrell. All rights reserved.
|
2
2
|
# Licensed under the terms of the BSD 2-clause license.
|
3
3
|
|
4
|
-
require 'command-t/ext' # CommandT::Matcher
|
5
|
-
require 'command-t/scanner/mru_buffer_scanner'
|
6
|
-
require 'command-t/finder/buffer_finder'
|
7
|
-
|
8
4
|
module CommandT
|
9
|
-
class
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
class Finder
|
6
|
+
class MRUBufferFinder < BufferFinder
|
7
|
+
def initialize
|
8
|
+
@scanner = Scanner::MRUBufferScanner.new
|
9
|
+
@matcher = Matcher.new @scanner, :always_show_dot_files => true
|
10
|
+
end
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
# Override sorted_matches_for to prevent MRU ordered matches from being
|
13
|
+
# ordered alphabetically.
|
14
|
+
def sorted_matches_for(str, options = {})
|
15
|
+
matches = super(str, options.merge(:sort => false))
|
19
16
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
17
|
+
# take current buffer (by definition, the most recently used) and move it
|
18
|
+
# to the end of the results
|
19
|
+
if MRU.last &&
|
20
|
+
relative_path_under_working_directory(MRU.last.name) == matches.first
|
21
|
+
matches[1..-1] + [matches.first]
|
22
|
+
else
|
23
|
+
matches
|
24
|
+
end
|
27
25
|
end
|
28
|
-
end
|
29
|
-
end # class
|
26
|
+
end # class MRUBufferFinder
|
27
|
+
end # class Finder
|
30
28
|
end # CommandT
|
@@ -1,28 +1,26 @@
|
|
1
1
|
# Copyright 2011-2014 Greg Hurrell. All rights reserved.
|
2
2
|
# Licensed under the terms of the BSD 2-clause license.
|
3
3
|
|
4
|
-
require 'command-t/ext' # CommandT::Matcher
|
5
|
-
require 'command-t/scanner/tag_scanner'
|
6
|
-
require 'command-t/finder'
|
7
|
-
|
8
4
|
module CommandT
|
9
|
-
class
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
def open_selection(command, selection, options = {})
|
16
|
-
if @scanner.include_filenames
|
17
|
-
selection = selection[0, selection.index(':')]
|
5
|
+
class Finder
|
6
|
+
class TagFinder < Finder
|
7
|
+
def initialize(options = {})
|
8
|
+
@scanner = Scanner::TagScanner.new options
|
9
|
+
@matcher = Matcher.new @scanner, :always_show_dot_files => true
|
18
10
|
end
|
19
11
|
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
def open_selection(command, selection, options = {})
|
13
|
+
if @scanner.include_filenames
|
14
|
+
selection = selection[0, selection.index(':')]
|
15
|
+
end
|
23
16
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
17
|
+
# open the tag and center the screen on it
|
18
|
+
::VIM::command "silent! tag #{selection} | :normal zz"
|
19
|
+
end
|
20
|
+
|
21
|
+
def flush
|
22
|
+
@scanner.flush
|
23
|
+
end
|
24
|
+
end # class TagFinder
|
25
|
+
end # class Finder
|
28
26
|
end # module CommandT
|
@@ -1,8 +1,7 @@
|
|
1
|
-
# Copyright 2010-
|
1
|
+
# Copyright 2010-2015 Greg Hurrell. All rights reserved.
|
2
2
|
# Licensed under the terms of the BSD 2-clause license.
|
3
3
|
|
4
4
|
require 'ostruct'
|
5
|
-
require 'command-t/settings'
|
6
5
|
|
7
6
|
module CommandT
|
8
7
|
class MatchWindow
|
@@ -13,6 +12,8 @@ module CommandT
|
|
13
12
|
MH_END = '</commandt>'
|
14
13
|
@@buffer = nil
|
15
14
|
|
15
|
+
Highlight = Struct.new(:highlight, :bang)
|
16
|
+
|
16
17
|
def initialize(options = {})
|
17
18
|
@highlight_color = options[:highlight_color] || 'PmenuSel'
|
18
19
|
@min_height = options[:min_height]
|
@@ -102,15 +103,21 @@ module CommandT
|
|
102
103
|
# perform cleanup using an autocmd to ensure we don't get caught out
|
103
104
|
# by some unexpected means of dismissing or leaving the Command-T window
|
104
105
|
# (eg. <C-W q>, <C-W k> etc)
|
105
|
-
::VIM::command '
|
106
|
+
::VIM::command 'augroup CommandTMatchWindow'
|
107
|
+
::VIM::command 'autocmd!'
|
106
108
|
::VIM::command 'autocmd BufLeave <buffer> silent! ruby $command_t.leave'
|
107
109
|
::VIM::command 'autocmd BufUnload <buffer> silent! ruby $command_t.unload'
|
110
|
+
::VIM::command 'augroup END'
|
108
111
|
|
109
112
|
@has_focus = false
|
110
113
|
@abbrev = ''
|
111
114
|
@window = $curwin
|
112
115
|
end
|
113
116
|
|
117
|
+
def buffer_number
|
118
|
+
@@buffer && @@buffer.number
|
119
|
+
end
|
120
|
+
|
114
121
|
def close
|
115
122
|
# Unlisted buffers like those provided by Netrw, NERDTree and Vim's help
|
116
123
|
# don't actually appear in the buffer list; if they are the only such
|
@@ -197,7 +204,7 @@ module CommandT
|
|
197
204
|
def find(char)
|
198
205
|
# is this a new search or the continuation of a previous one?
|
199
206
|
now = Time.now
|
200
|
-
if @last_key_time.nil?
|
207
|
+
if @last_key_time.nil? || @last_key_time < (now - 0.5)
|
201
208
|
@find_string = char
|
202
209
|
else
|
203
210
|
@find_string += char
|
@@ -401,21 +408,28 @@ module CommandT
|
|
401
408
|
end
|
402
409
|
|
403
410
|
def get_cursor_highlight
|
404
|
-
# there are
|
411
|
+
# there are 4 possible formats to check for, each needing to be
|
405
412
|
# transformed in a certain way in order to reapply the highlight:
|
406
413
|
# Cursor xxx guifg=bg guibg=fg -> :hi! Cursor guifg=bg guibg=fg
|
407
414
|
# Cursor xxx links to SomethingElse -> :hi! link Cursor SomethingElse
|
415
|
+
# Cursor xxx [definition]
|
416
|
+
# links to VisualNOS -> both of the above
|
408
417
|
# Cursor xxx cleared -> :hi! clear Cursor
|
409
418
|
highlight = VIM::capture 'silent! 0verbose highlight Cursor'
|
410
419
|
|
411
|
-
if highlight =~ /^Cursor\s+xxx\s+
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
420
|
+
if highlight =~ /^Cursor\s+xxx\s+(.+)\blinks to (\w+)/m
|
421
|
+
[
|
422
|
+
Highlight.new("Cursor #{$~[1]}"),
|
423
|
+
Highlight.new("link Cursor #{$~[2]}", '!')
|
424
|
+
]
|
425
|
+
elsif highlight =~ /^Cursor\s+xxx\s+links to (\w+)/m
|
426
|
+
[Highlight.new("link Cursor #{$~[1]}")]
|
427
|
+
elsif highlight =~ /^Cursor\s+xxx\s+cleared/m
|
428
|
+
[Highlight.new('clear Cursor')]
|
429
|
+
elsif highlight =~ /Cursor\s+xxx\s+(.+)/m
|
430
|
+
[Highlight.new("Cursor #{$~[1]}")]
|
417
431
|
else # likely cause E411 Cursor highlight group not found
|
418
|
-
|
432
|
+
[]
|
419
433
|
end
|
420
434
|
end
|
421
435
|
|
@@ -427,7 +441,10 @@ module CommandT
|
|
427
441
|
|
428
442
|
def show_cursor
|
429
443
|
if @cursor_highlight
|
430
|
-
|
444
|
+
@cursor_highlight.each do |highlight|
|
445
|
+
config = highlight.highlight.gsub(/\s+/, ' ')
|
446
|
+
::VIM::command "highlight#{highlight.bang} #{config}"
|
447
|
+
end
|
431
448
|
end
|
432
449
|
end
|
433
450
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Copyright 2010-2014 Greg Hurrell. All rights reserved.
|
2
|
+
# Licensed under the terms of the BSD 2-clause license.
|
3
|
+
|
4
|
+
module CommandT
|
5
|
+
module PathUtilities
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def relative_path_under_working_directory(path)
|
10
|
+
# any path under the working directory will be specified as a relative
|
11
|
+
# path to improve the readability of the buffer list etc
|
12
|
+
pwd = File.expand_path(VIM::pwd) + '/'
|
13
|
+
path.index(pwd) == 0 ? path[pwd.length..-1] : path
|
14
|
+
end
|
15
|
+
|
16
|
+
end # module PathUtilities
|
17
|
+
end # module CommandT
|
data/ruby/command-t/prompt.rb
CHANGED
@@ -150,7 +150,7 @@ module CommandT
|
|
150
150
|
# prevent the status line from getting inadvertantly cleared
|
151
151
|
# after our echo commands
|
152
152
|
::VIM::command 'redraw'
|
153
|
-
while (highlight = args.shift)
|
153
|
+
while (highlight = args.shift) && (text = args.shift)
|
154
154
|
text = VIM::escape_for_single_quotes text
|
155
155
|
::VIM::command "echohl #{highlight}"
|
156
156
|
::VIM::command "echon '#{text}'"
|
data/ruby/command-t/scanner.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
# Copyright 2010-2014 Greg Hurrell. All rights reserved.
|
2
2
|
# Licensed under the terms of the BSD 2-clause license.
|
3
3
|
|
4
|
-
require 'command-t/vim'
|
5
|
-
|
6
4
|
module CommandT
|
7
|
-
class Scanner
|
5
|
+
class Scanner
|
6
|
+
autoload :BufferScanner, 'command-t/scanner/buffer_scanner'
|
7
|
+
autoload :FileScanner, 'command-t/scanner/file_scanner'
|
8
|
+
autoload :JumpScanner, 'command-t/scanner/jump_scanner'
|
9
|
+
autoload :MRUBufferScanner, 'command-t/scanner/mru_buffer_scanner'
|
10
|
+
autoload :TagScanner, 'command-t/scanner/tag_scanner'
|
11
|
+
end # class Scanner
|
8
12
|
end # module CommandT
|
@@ -1,21 +1,20 @@
|
|
1
1
|
# Copyright 2010-2014 Greg Hurrell. All rights reserved.
|
2
2
|
# Licensed under the terms of the BSD 2-clause license.
|
3
3
|
|
4
|
-
require 'command-t/vim/path_utilities'
|
5
|
-
require 'command-t/scanner'
|
6
|
-
|
7
4
|
module CommandT
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
class Scanner
|
6
|
+
# Returns a list of all open buffers.
|
7
|
+
class BufferScanner < Scanner
|
8
|
+
include PathUtilities
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
10
|
+
def paths
|
11
|
+
(0..(::VIM::Buffer.count - 1)).map do |n|
|
12
|
+
buffer = ::VIM::Buffer[n]
|
13
|
+
if buffer.name # beware, may be nil
|
14
|
+
relative_path_under_working_directory buffer.name
|
15
|
+
end
|
16
|
+
end.compact
|
17
|
+
end
|
18
|
+
end # class BufferScanner
|
19
|
+
end # class Scanner
|
21
20
|
end # module CommandT
|
@@ -1,85 +1,94 @@
|
|
1
1
|
# Copyright 2010-2014 Greg Hurrell. All rights reserved.
|
2
2
|
# Licensed under the terms of the BSD 2-clause license.
|
3
3
|
|
4
|
-
require 'command-t/scanner'
|
5
|
-
|
6
4
|
module CommandT
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
class
|
14
|
-
|
5
|
+
class Scanner
|
6
|
+
# Reads the current directory recursively for the paths to all regular files.
|
7
|
+
#
|
8
|
+
# This is an abstract superclass; the real work is done by subclasses which
|
9
|
+
# obtain file listings via different strategies (for examples, see the
|
10
|
+
# RubyFileScanner and FindFileScanner subclasses).
|
11
|
+
class FileScanner < Scanner
|
12
|
+
# Errors
|
13
|
+
autoload :FileLimitExceeded, 'command-t/scanner/file_scanner/file_limit_exceeded'
|
14
|
+
|
15
|
+
# Subclasses
|
16
|
+
autoload :FindFileScanner, 'command-t/scanner/file_scanner/find_file_scanner'
|
17
|
+
autoload :GitFileScanner, 'command-t/scanner/file_scanner/git_file_scanner'
|
18
|
+
autoload :RubyFileScanner, 'command-t/scanner/file_scanner/ruby_file_scanner'
|
19
|
+
autoload :WatchmanFileScanner, 'command-t/scanner/file_scanner/watchman_file_scanner'
|
15
20
|
|
16
|
-
|
17
|
-
@paths = {}
|
18
|
-
@paths_keys = []
|
19
|
-
@path = path
|
20
|
-
@max_depth = options[:max_depth] || 15
|
21
|
-
@max_files = options[:max_files] || 30_000
|
22
|
-
@max_caches = options[:max_caches] || 1
|
23
|
-
@scan_dot_directories = options[:scan_dot_directories] || false
|
24
|
-
@wild_ignore = options[:wild_ignore]
|
25
|
-
@base_wild_ignore = wild_ignore
|
26
|
-
end
|
21
|
+
attr_accessor :path
|
27
22
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
@
|
32
|
-
|
23
|
+
def initialize(path = Dir.pwd, options = {})
|
24
|
+
@paths = {}
|
25
|
+
@paths_keys = []
|
26
|
+
@path = path
|
27
|
+
@max_depth = options[:max_depth] || 15
|
28
|
+
@max_files = options[:max_files] || 30_000
|
29
|
+
@max_caches = options[:max_caches] || 1
|
30
|
+
@scan_dot_directories = options[:scan_dot_directories] || false
|
31
|
+
@wild_ignore = options[:wild_ignore]
|
32
|
+
@scan_submodules = options[:git_scan_submodules] || false
|
33
|
+
@base_wild_ignore = wild_ignore
|
33
34
|
end
|
34
|
-
end
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
def paths
|
37
|
+
@paths[@path] ||= begin
|
38
|
+
ensure_cache_under_limit
|
39
|
+
@prefix_len = @path.chomp('/').length + 1
|
40
|
+
set_wild_ignore { paths! }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def flush
|
45
|
+
@paths = {}
|
46
|
+
end
|
39
47
|
|
40
|
-
|
48
|
+
private
|
41
49
|
|
42
|
-
|
43
|
-
|
44
|
-
|
50
|
+
def wild_ignore
|
51
|
+
VIM::exists?('&wildignore') && ::VIM::evaluate('&wildignore').to_s
|
52
|
+
end
|
45
53
|
|
46
|
-
|
47
|
-
|
48
|
-
|
54
|
+
def paths!
|
55
|
+
raise RuntimeError, 'Subclass responsibility'
|
56
|
+
end
|
49
57
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
58
|
+
def ensure_cache_under_limit
|
59
|
+
# Ruby 1.8 doesn't have an ordered hash, so use a separate stack to
|
60
|
+
# track and expire the oldest entry in the cache
|
61
|
+
if @max_caches > 0 && @paths_keys.length >= @max_caches
|
62
|
+
@paths.delete @paths_keys.shift
|
63
|
+
end
|
64
|
+
@paths_keys << @path
|
55
65
|
end
|
56
|
-
@paths_keys << @path
|
57
|
-
end
|
58
66
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
67
|
+
def path_excluded?(path, prefix_len = @prefix_len)
|
68
|
+
if apply_wild_ignore?
|
69
|
+
# first strip common prefix (@path) from path to match VIM's behavior
|
70
|
+
path = path[prefix_len..-1]
|
71
|
+
path = VIM::escape_for_single_quotes path
|
72
|
+
::VIM::evaluate("empty(expand(fnameescape('#{path}')))").to_i == 1
|
73
|
+
end
|
65
74
|
end
|
66
|
-
end
|
67
75
|
|
68
|
-
|
69
|
-
|
70
|
-
|
76
|
+
def has_custom_wild_ignore?
|
77
|
+
@wild_ignore && !@wild_ignore.empty?
|
78
|
+
end
|
71
79
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
80
|
+
# Used to skip expensive calls to `expand()` when there is no applicable
|
81
|
+
# wildignore.
|
82
|
+
def apply_wild_ignore?
|
83
|
+
has_custom_wild_ignore? || @base_wild_ignore
|
84
|
+
end
|
77
85
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
86
|
+
def set_wild_ignore(&block)
|
87
|
+
::VIM::command("set wildignore=#{@wild_ignore}") if has_custom_wild_ignore?
|
88
|
+
yield
|
89
|
+
ensure
|
90
|
+
::VIM::command("set wildignore=#{@base_wild_ignore}") if has_custom_wild_ignore?
|
91
|
+
end
|
92
|
+
end # class FileScanner
|
93
|
+
end # class Scanner
|
85
94
|
end # module CommandT
|