command-t 1.11.4 → 1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,33 +1,33 @@
|
|
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/scanner'
|
5
|
-
|
6
4
|
module CommandT
|
7
|
-
class
|
8
|
-
|
5
|
+
class Scanner
|
6
|
+
class TagScanner < Scanner
|
7
|
+
attr_reader :include_filenames
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
def initialize(options = {})
|
10
|
+
@include_filenames = options[:include_filenames] || false
|
11
|
+
@cached_tags = nil
|
12
|
+
end
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
14
|
+
def paths
|
15
|
+
@cached_tags ||= taglist.map do |tag|
|
16
|
+
path = tag['name']
|
17
|
+
path << ":#{tag['filename']}" if @include_filenames
|
18
|
+
path
|
19
|
+
end.uniq.sort
|
20
|
+
end
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
def flush
|
23
|
+
@cached_tags = nil
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
private
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
def taglist
|
29
|
+
::VIM::evaluate 'taglist(".")'
|
30
|
+
end
|
31
|
+
end # class TagScanner
|
32
|
+
end # class Scanner
|
33
33
|
end # module CommandT
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Copyright 2014 Greg Hurrell. All rights reserved.
|
2
|
+
# Licensed under the terms of the BSD 2-clause license.
|
3
|
+
|
4
|
+
module CommandT
|
5
|
+
module SCMUtilities
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def nearest_ancestor(starting_directory, markers)
|
10
|
+
path = File.expand_path(starting_directory)
|
11
|
+
while !markers.
|
12
|
+
map { |dir| File.join(path, dir) }.
|
13
|
+
map { |dir| File.exist?(dir) }.
|
14
|
+
any?
|
15
|
+
next_path = File.expand_path(File.join(path, '..'))
|
16
|
+
return nil if next_path == path
|
17
|
+
path = next_path
|
18
|
+
end
|
19
|
+
path
|
20
|
+
end
|
21
|
+
end # module SCMUtilities
|
22
|
+
end # module CommandT
|
data/ruby/command-t/settings.rb
CHANGED
data/ruby/command-t/util.rb
CHANGED
@@ -77,7 +77,7 @@ module CommandT
|
|
77
77
|
IO.popen(%w[/usr/sbin/pmcycles -m]).read.count("\n")
|
78
78
|
elsif File.executable?('/usr/sbin/lsdev')
|
79
79
|
IO.popen(%w[/usr/sbin/lsdev -Cc processor -S 1]).read.count("\n")
|
80
|
-
elsif File.executable?('/usr/sbin/sysconf')
|
80
|
+
elsif File.executable?('/usr/sbin/sysconf') && os_name =~ /irix/i
|
81
81
|
IO.popen(%w[/usr/sbin/sysconf NPROC_ONLN]).read.to_i
|
82
82
|
elsif File.executable?('/usr/sbin/sysctl')
|
83
83
|
IO.popen(%w[/usr/sbin/sysctl -n hw.ncpu]).read.to_i
|
data/ruby/command-t/vim.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
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/screen'
|
5
|
-
require 'command-t/vim/window'
|
6
|
-
|
7
4
|
module CommandT
|
8
5
|
module VIM
|
6
|
+
autoload :Screen, 'command-t/vim/screen'
|
7
|
+
autoload :Window, 'command-t/vim/window'
|
8
|
+
|
9
9
|
class << self
|
10
10
|
# Check for the existence of a feature such as "conceal" or "syntax".
|
11
11
|
def has?(feature)
|
data/ruby/command-t/watchman.c
CHANGED
@@ -28,21 +28,6 @@ typedef struct {
|
|
28
28
|
VALUE watchman_load(char **ptr, char *end);
|
29
29
|
void watchman_dump(watchman_t *w, VALUE serializable);
|
30
30
|
|
31
|
-
/**
|
32
|
-
* Inspect a ruby object (debugging aid)
|
33
|
-
*/
|
34
|
-
#define ruby_inspect(obj) rb_funcall(rb_mKernel, rb_intern("p"), 1, obj)
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Print `count` bytes of memory at `address` (debugging aid)
|
38
|
-
*/
|
39
|
-
#define dump(address, count) \
|
40
|
-
do { \
|
41
|
-
for (int i = 0; i < count; i++) { \
|
42
|
-
printf("%02x ", ((unsigned char *)address)[i]); printf("\n"); \
|
43
|
-
} \
|
44
|
-
} while(0)
|
45
|
-
|
46
31
|
#define WATCHMAN_DEFAULT_STORAGE 4096
|
47
32
|
|
48
33
|
#define WATCHMAN_BINARY_MARKER "\x00\x01"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: command-t
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.12'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Hurrell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
Command-T provides a fast, intuitive mechanism for opening files with a
|
@@ -44,9 +44,11 @@ files:
|
|
44
44
|
- ruby/command-t/matcher.c
|
45
45
|
- ruby/command-t/matcher.h
|
46
46
|
- ruby/command-t/mru.rb
|
47
|
+
- ruby/command-t/path_utilities.rb
|
47
48
|
- ruby/command-t/prompt.rb
|
48
49
|
- ruby/command-t/ruby_compat.h
|
49
50
|
- ruby/command-t/scanner/buffer_scanner.rb
|
51
|
+
- ruby/command-t/scanner/file_scanner/file_limit_exceeded.rb
|
50
52
|
- ruby/command-t/scanner/file_scanner/find_file_scanner.rb
|
51
53
|
- ruby/command-t/scanner/file_scanner/git_file_scanner.rb
|
52
54
|
- ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb
|
@@ -56,15 +58,16 @@ files:
|
|
56
58
|
- ruby/command-t/scanner/mru_buffer_scanner.rb
|
57
59
|
- ruby/command-t/scanner/tag_scanner.rb
|
58
60
|
- ruby/command-t/scanner.rb
|
61
|
+
- ruby/command-t/scm_utilities.rb
|
59
62
|
- ruby/command-t/settings.rb
|
60
63
|
- ruby/command-t/stub.rb
|
61
64
|
- ruby/command-t/util.rb
|
62
|
-
- ruby/command-t/vim/path_utilities.rb
|
63
65
|
- ruby/command-t/vim/screen.rb
|
64
66
|
- ruby/command-t/vim/window.rb
|
65
67
|
- ruby/command-t/vim.rb
|
66
68
|
- ruby/command-t/watchman.c
|
67
69
|
- ruby/command-t/watchman.h
|
70
|
+
- ruby/command-t.rb
|
68
71
|
- doc/command-t.txt
|
69
72
|
- doc/tags
|
70
73
|
- plugin/command-t.vim
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# Copyright 2010-2014 Greg Hurrell. All rights reserved.
|
2
|
-
# Licensed under the terms of the BSD 2-clause license.
|
3
|
-
|
4
|
-
require 'command-t/vim'
|
5
|
-
|
6
|
-
module CommandT
|
7
|
-
module VIM
|
8
|
-
module PathUtilities
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
def relative_path_under_working_directory(path)
|
13
|
-
# any path under the working directory will be specified as a relative
|
14
|
-
# path to improve the readability of the buffer list etc
|
15
|
-
pwd = File.expand_path(VIM::pwd) + '/'
|
16
|
-
path.index(pwd) == 0 ? path[pwd.length..-1] : path
|
17
|
-
end
|
18
|
-
|
19
|
-
def nearest_ancestor(starting_directory, markers)
|
20
|
-
path = File.expand_path(starting_directory)
|
21
|
-
while !markers.
|
22
|
-
map { |dir| File.join(path, dir) }.
|
23
|
-
map { |dir| File.exist?(dir) }.
|
24
|
-
any?
|
25
|
-
next_path = File.expand_path(File.join(path, '..'))
|
26
|
-
return nil if next_path == path
|
27
|
-
path = next_path
|
28
|
-
end
|
29
|
-
path
|
30
|
-
end
|
31
|
-
|
32
|
-
end # module PathUtilities
|
33
|
-
end # module VIM
|
34
|
-
end # module CommandT
|