command-t 1.6.1 → 1.7
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/Gemfile +1 -1
- data/LICENSE +1 -1
- data/README.txt +169 -21
- data/Rakefile +0 -12
- data/doc/command-t.txt +169 -21
- data/doc/tags +57 -0
- data/plugin/command-t.vim +5 -1
- data/ruby/command-t/Makefile +40 -39
- data/ruby/command-t/controller.rb +40 -22
- data/ruby/command-t/ext.bundle +0 -0
- data/ruby/command-t/extconf.rb +5 -3
- data/ruby/command-t/finder/file_finder.rb +17 -5
- data/ruby/command-t/match_window.rb +37 -37
- data/ruby/command-t/scanner/file_scanner.rb +10 -45
- data/ruby/command-t/scanner/file_scanner/find_file_scanner.rb +77 -0
- data/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb +78 -0
- data/ruby/command-t/scanner/file_scanner/watchman_file_scanner.rb +79 -0
- data/ruby/command-t/settings.rb +83 -32
- data/ruby/command-t/util.rb +3 -1
- metadata +17 -13
data/ruby/command-t/settings.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2010 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:
|
@@ -24,54 +24,105 @@
|
|
24
24
|
module CommandT
|
25
25
|
# Convenience class for saving and restoring global settings.
|
26
26
|
class Settings
|
27
|
+
# Settings which apply globally and so must be manually saved and restored
|
28
|
+
GLOBAL_SETTINGS = %w[
|
29
|
+
equalalways
|
30
|
+
hlsearch
|
31
|
+
insertmode
|
32
|
+
report
|
33
|
+
showcmd
|
34
|
+
sidescroll
|
35
|
+
sidescrolloff
|
36
|
+
timeout
|
37
|
+
timeoutlen
|
38
|
+
updatetime
|
39
|
+
]
|
40
|
+
|
41
|
+
# Settings which can be made locally to the Command-T buffer or window
|
42
|
+
LOCAL_SETTINGS = %w[
|
43
|
+
bufhidden
|
44
|
+
buflisted
|
45
|
+
buftype
|
46
|
+
colorcolumn
|
47
|
+
concealcursor
|
48
|
+
conceallevel
|
49
|
+
cursorline
|
50
|
+
foldcolumn
|
51
|
+
foldlevel
|
52
|
+
list
|
53
|
+
modifiable
|
54
|
+
number
|
55
|
+
relativenumber
|
56
|
+
spell
|
57
|
+
swapfile
|
58
|
+
synmaxcol
|
59
|
+
textwidth
|
60
|
+
wrap
|
61
|
+
]
|
62
|
+
|
63
|
+
KNOWN_SETTINGS = GLOBAL_SETTINGS + LOCAL_SETTINGS
|
64
|
+
|
27
65
|
def initialize
|
28
|
-
|
66
|
+
@settings = []
|
29
67
|
end
|
30
68
|
|
31
|
-
def
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
69
|
+
def set(setting, value)
|
70
|
+
raise "Unknown setting #{setting}" unless KNOWN_SETTINGS.include?(setting)
|
71
|
+
|
72
|
+
case value
|
73
|
+
when TrueClass, FalseClass
|
74
|
+
@settings.push([setting, get_bool(setting)]) if global?(setting)
|
75
|
+
set_bool setting, value
|
76
|
+
when Numeric
|
77
|
+
@settings.push([setting, get_number(setting)]) if global?(setting)
|
78
|
+
set_number setting, value
|
79
|
+
when String
|
80
|
+
@settings.push([setting, get_string(setting)]) if global?(setting)
|
81
|
+
set_string setting, value
|
82
|
+
end
|
41
83
|
end
|
42
84
|
|
43
85
|
def restore
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
86
|
+
@settings.each do |setting, value|
|
87
|
+
case value
|
88
|
+
when TrueClass, FalseClass
|
89
|
+
set_bool setting, value
|
90
|
+
when Numeric
|
91
|
+
set_number setting, value
|
92
|
+
when String
|
93
|
+
set_string setting, value
|
94
|
+
end
|
95
|
+
end
|
53
96
|
end
|
54
97
|
|
55
98
|
private
|
56
99
|
|
57
|
-
def
|
58
|
-
|
100
|
+
def global?(setting)
|
101
|
+
GLOBAL_SETTINGS.include?(setting)
|
59
102
|
end
|
60
103
|
|
61
|
-
def get_bool
|
104
|
+
def get_bool(setting)
|
62
105
|
::VIM::evaluate("&#{setting}").to_i == 1
|
63
106
|
end
|
64
107
|
|
65
|
-
def
|
66
|
-
::VIM::
|
108
|
+
def get_number(setting)
|
109
|
+
::VIM::evaluate("&#{setting}").to_i
|
67
110
|
end
|
68
111
|
|
69
|
-
def
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
112
|
+
def get_string(name)
|
113
|
+
::VIM::evaluate("&#{name}").to_s
|
114
|
+
end
|
115
|
+
|
116
|
+
def set_bool(setting, value)
|
117
|
+
command = global?(setting) ? 'set' : 'setlocal'
|
118
|
+
setting = value ? setting : "no#{setting}"
|
119
|
+
::VIM::command "#{command} #{setting}"
|
120
|
+
end
|
121
|
+
|
122
|
+
def set_number(setting, value)
|
123
|
+
command = global?(setting) ? 'set' : 'setlocal'
|
124
|
+
::VIM::command "#{command} #{setting}=#{value}"
|
75
125
|
end
|
126
|
+
alias set_string set_number
|
76
127
|
end # class Settings
|
77
128
|
end # module CommandT
|
data/ruby/command-t/util.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2013 Wincent Colaiuta. All rights reserved.
|
1
|
+
# Copyright 2013-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:
|
@@ -21,6 +21,8 @@
|
|
21
21
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
22
22
|
# POSSIBILITY OF SUCH DAMAGE.
|
23
23
|
|
24
|
+
require 'rbconfig'
|
25
|
+
|
24
26
|
module CommandT
|
25
27
|
module Util
|
26
28
|
class << self
|
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.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wincent Colaiuta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-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
|
@@ -21,22 +21,25 @@ extensions:
|
|
21
21
|
- ruby/command-t/extconf.rb
|
22
22
|
extra_rdoc_files: []
|
23
23
|
files:
|
24
|
-
- README.txt
|
25
|
-
- LICENSE
|
26
24
|
- Gemfile
|
25
|
+
- LICENSE
|
26
|
+
- README.txt
|
27
27
|
- Rakefile
|
28
|
+
- doc/command-t.txt
|
29
|
+
- doc/tags
|
30
|
+
- plugin/command-t.vim
|
31
|
+
- ruby/command-t/Makefile
|
28
32
|
- ruby/command-t/controller.rb
|
29
33
|
- ruby/command-t/depend
|
30
34
|
- ruby/command-t/ext.bundle
|
31
35
|
- ruby/command-t/ext.c
|
32
36
|
- ruby/command-t/ext.h
|
33
37
|
- ruby/command-t/extconf.rb
|
38
|
+
- ruby/command-t/finder.rb
|
34
39
|
- ruby/command-t/finder/buffer_finder.rb
|
35
40
|
- ruby/command-t/finder/file_finder.rb
|
36
41
|
- ruby/command-t/finder/jump_finder.rb
|
37
42
|
- ruby/command-t/finder/tag_finder.rb
|
38
|
-
- ruby/command-t/finder.rb
|
39
|
-
- ruby/command-t/Makefile
|
40
43
|
- ruby/command-t/match.c
|
41
44
|
- ruby/command-t/match.h
|
42
45
|
- ruby/command-t/match_window.rb
|
@@ -44,20 +47,21 @@ files:
|
|
44
47
|
- ruby/command-t/matcher.h
|
45
48
|
- ruby/command-t/prompt.rb
|
46
49
|
- ruby/command-t/ruby_compat.h
|
50
|
+
- ruby/command-t/scanner.rb
|
47
51
|
- ruby/command-t/scanner/buffer_scanner.rb
|
48
52
|
- ruby/command-t/scanner/file_scanner.rb
|
53
|
+
- ruby/command-t/scanner/file_scanner/find_file_scanner.rb
|
54
|
+
- ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb
|
55
|
+
- ruby/command-t/scanner/file_scanner/watchman_file_scanner.rb
|
49
56
|
- ruby/command-t/scanner/jump_scanner.rb
|
50
57
|
- ruby/command-t/scanner/tag_scanner.rb
|
51
|
-
- ruby/command-t/scanner.rb
|
52
58
|
- ruby/command-t/settings.rb
|
53
59
|
- ruby/command-t/stub.rb
|
54
60
|
- ruby/command-t/util.rb
|
61
|
+
- ruby/command-t/vim.rb
|
55
62
|
- ruby/command-t/vim/path_utilities.rb
|
56
63
|
- ruby/command-t/vim/screen.rb
|
57
64
|
- ruby/command-t/vim/window.rb
|
58
|
-
- ruby/command-t/vim.rb
|
59
|
-
- doc/command-t.txt
|
60
|
-
- plugin/command-t.vim
|
61
65
|
homepage: https://wincent.com/products/command-t
|
62
66
|
licenses: []
|
63
67
|
metadata: {}
|
@@ -67,17 +71,17 @@ require_paths:
|
|
67
71
|
- ruby
|
68
72
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
73
|
requirements:
|
70
|
-
- -
|
74
|
+
- - ">="
|
71
75
|
- !ruby/object:Gem::Version
|
72
76
|
version: '0'
|
73
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
78
|
requirements:
|
75
|
-
- -
|
79
|
+
- - ">="
|
76
80
|
- !ruby/object:Gem::Version
|
77
81
|
version: '0'
|
78
82
|
requirements: []
|
79
83
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.
|
84
|
+
rubygems_version: 2.2.2
|
81
85
|
signing_key:
|
82
86
|
specification_version: 4
|
83
87
|
summary: The Command-T plug-in for VIM.
|