command-t 3.0.2 → 4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -2
  3. data/doc/command-t.txt +312 -147
  4. data/ruby/command-t.rb +13 -12
  5. data/ruby/command-t/controller.rb +86 -15
  6. data/ruby/command-t/depend +4 -0
  7. data/ruby/command-t/ext.h +9 -2
  8. data/ruby/command-t/extconf.rb +2 -2
  9. data/ruby/command-t/finder.rb +6 -2
  10. data/ruby/command-t/finder/buffer_finder.rb +3 -3
  11. data/ruby/command-t/finder/command_finder.rb +23 -0
  12. data/ruby/command-t/finder/file_finder.rb +3 -3
  13. data/ruby/command-t/finder/help_finder.rb +25 -0
  14. data/ruby/command-t/finder/history_finder.rb +27 -0
  15. data/ruby/command-t/finder/jump_finder.rb +3 -3
  16. data/ruby/command-t/finder/line_finder.rb +23 -0
  17. data/ruby/command-t/finder/mru_buffer_finder.rb +3 -3
  18. data/ruby/command-t/finder/tag_finder.rb +3 -3
  19. data/ruby/command-t/heap.c +146 -0
  20. data/ruby/command-t/heap.h +22 -0
  21. data/ruby/command-t/match.c +183 -116
  22. data/ruby/command-t/match.h +16 -10
  23. data/ruby/command-t/match_window.rb +10 -1
  24. data/ruby/command-t/matcher.c +203 -63
  25. data/ruby/command-t/metadata/fallback.rb +2 -2
  26. data/ruby/command-t/mru.rb +2 -2
  27. data/ruby/command-t/path_utilities.rb +2 -2
  28. data/ruby/command-t/progress_reporter.rb +38 -0
  29. data/ruby/command-t/prompt.rb +4 -4
  30. data/ruby/command-t/scanner.rb +22 -2
  31. data/ruby/command-t/scanner/buffer_scanner.rb +3 -3
  32. data/ruby/command-t/scanner/command_scanner.rb +33 -0
  33. data/ruby/command-t/scanner/file_scanner.rb +30 -6
  34. data/ruby/command-t/scanner/file_scanner/find_file_scanner.rb +12 -7
  35. data/ruby/command-t/scanner/file_scanner/git_file_scanner.rb +11 -8
  36. data/ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb +7 -4
  37. data/ruby/command-t/scanner/file_scanner/watchman_file_scanner.rb +13 -5
  38. data/ruby/command-t/scanner/help_scanner.rb +40 -0
  39. data/ruby/command-t/scanner/history_scanner.rb +24 -0
  40. data/ruby/command-t/scanner/jump_scanner.rb +3 -3
  41. data/ruby/command-t/scanner/line_scanner.rb +45 -0
  42. data/ruby/command-t/scanner/mru_buffer_scanner.rb +3 -3
  43. data/ruby/command-t/scanner/tag_scanner.rb +3 -3
  44. data/ruby/command-t/scm_utilities.rb +2 -2
  45. data/ruby/command-t/settings.rb +2 -2
  46. data/ruby/command-t/stub.rb +7 -2
  47. data/ruby/command-t/util.rb +2 -2
  48. data/ruby/command-t/vim.rb +27 -2
  49. data/ruby/command-t/vim/screen.rb +3 -3
  50. data/ruby/command-t/vim/window.rb +3 -3
  51. data/ruby/command-t/watchman.c +1 -1
  52. metadata +13 -2
@@ -22,6 +22,6 @@ module CommandT
22
22
  end
23
23
  end.compact.reverse
24
24
  end
25
- end # class MRUBufferScanner
26
- end # class Scanner
27
- end # module CommandT
25
+ end
26
+ end
27
+ end
@@ -28,6 +28,6 @@ module CommandT
28
28
  def taglist
29
29
  ::VIM::evaluate 'taglist(".")'
30
30
  end
31
- end # class TagScanner
32
- end # class Scanner
33
- end # module CommandT
31
+ end
32
+ end
33
+ end
@@ -18,5 +18,5 @@ module CommandT
18
18
  end
19
19
  path
20
20
  end
21
- end # module SCMUtilities
22
- end # module CommandT
21
+ end
22
+ end
@@ -95,5 +95,5 @@ module CommandT
95
95
  ::VIM::command "#{command} #{setting}=#{value}"
96
96
  end
97
97
  alias set_string set_number
98
- end # class Settings
99
- end # module CommandT
98
+ end
99
+ end
@@ -15,9 +15,14 @@ module CommandT
15
15
  [
16
16
  :flush,
17
17
  :show_buffer_finder,
18
+ :show_command_finder,
18
19
  :show_file_finder,
20
+ :show_history_finder,
21
+ :show_help_finder,
19
22
  :show_jump_finder,
23
+ :show_line_finder,
20
24
  :show_mru_finder,
25
+ :show_search_finder,
21
26
  :show_tag_finder
22
27
  ].each do |method|
23
28
  define_method(method) { warn *@@load_error }
@@ -30,5 +35,5 @@ module CommandT
30
35
  msg.each { |m| ::VIM::command "echo '#{m}'" }
31
36
  ::VIM::command 'echohl none'
32
37
  end
33
- end # class Stub
34
- end # module CommandT
38
+ end
39
+ end
@@ -90,5 +90,5 @@ module CommandT
90
90
  1
91
91
  end
92
92
  end
93
- end # module Util
94
- end # module CommandT
93
+ end
94
+ end
@@ -66,6 +66,31 @@ module CommandT
66
66
  def escape_for_single_quotes(str)
67
67
  str.gsub "'", "''"
68
68
  end
69
+
70
+ # Conservatively convert wildignore patterns that we understand to a
71
+ # regex. Supported patterns noted in the inline comments below.
72
+ #
73
+ # If this ends up doing something wrong, set `g:CommandTWildIgnore` to ''
74
+ # to opt out or otherwise override to produce a conforming pattern.
75
+ def wildignore_to_regexp(str)
76
+ patterns = str.split(',')
77
+ regex = patterns.map do |pattern|
78
+ if pattern.match(%r{\A([^*/]+)\z})
79
+ # something (match file at any level)
80
+ '(\A|/)' + Regexp.escape($~[1]) + '\z'
81
+ elsif pattern.match(%r{\A\*\.([^*]+)\z})
82
+ # *.something (match file with extension at any level)
83
+ '\.' + Regexp.escape($~[1]) + '\z'
84
+ elsif pattern.match(%r{\A\*/(.+)\z})
85
+ # */something (match files or directories at any level)
86
+ '(\A|/)' + Regexp.escape($~[1]) + '(/|\z)'
87
+ elsif pattern.match(%r{\A\*/([^*]+)/*\z})
88
+ # */something/* (match directories at any level)
89
+ '(\A|/)' + Regexp.escape($~[1]) + '(/|\z)'
90
+ end
91
+ end.compact.join('|')
92
+ Regexp.new(regex) unless regex.empty?
93
+ end
69
94
  end
70
- end # module VIM
71
- end # module CommandT
95
+ end
96
+ end
@@ -9,6 +9,6 @@ module CommandT
9
9
  ::VIM::evaluate('&lines').to_i
10
10
  end
11
11
  end
12
- end # module Screen
13
- end # module VIM
14
- end # module CommandT
12
+ end
13
+ end
14
+ end
@@ -15,6 +15,6 @@ module CommandT
15
15
  end
16
16
  end
17
17
  end
18
- end # module Window
19
- end # module VIM
20
- end # module CommandT
18
+ end
19
+ end
20
+ end
@@ -591,7 +591,7 @@ VALUE CommandTWatchmanUtils_query(VALUE self, VALUE query, VALUE socket) {
591
591
  if (sent == -1) {
592
592
  watchman_raise_system_call_error(errno);
593
593
  } else if (sent != query_len) {
594
- rb_raise(rb_eRuntimeError, "expected to send %ld bytes but sent %ld",
594
+ rb_raise(rb_eRuntimeError, "expected to send %ld bytes but sent %zd",
595
595
  query_len, sent);
596
596
  }
597
597
 
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: 3.0.2
4
+ version: '4.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Hurrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-09 00:00:00.000000000 Z
11
+ date: 2016-05-17 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
@@ -36,10 +36,16 @@ files:
36
36
  - ruby/command-t/extconf.rb
37
37
  - ruby/command-t/finder.rb
38
38
  - ruby/command-t/finder/buffer_finder.rb
39
+ - ruby/command-t/finder/command_finder.rb
39
40
  - ruby/command-t/finder/file_finder.rb
41
+ - ruby/command-t/finder/help_finder.rb
42
+ - ruby/command-t/finder/history_finder.rb
40
43
  - ruby/command-t/finder/jump_finder.rb
44
+ - ruby/command-t/finder/line_finder.rb
41
45
  - ruby/command-t/finder/mru_buffer_finder.rb
42
46
  - ruby/command-t/finder/tag_finder.rb
47
+ - ruby/command-t/heap.c
48
+ - ruby/command-t/heap.h
43
49
  - ruby/command-t/match.c
44
50
  - ruby/command-t/match.h
45
51
  - ruby/command-t/match_window.rb
@@ -48,16 +54,21 @@ files:
48
54
  - ruby/command-t/metadata/fallback.rb
49
55
  - ruby/command-t/mru.rb
50
56
  - ruby/command-t/path_utilities.rb
57
+ - ruby/command-t/progress_reporter.rb
51
58
  - ruby/command-t/prompt.rb
52
59
  - ruby/command-t/ruby_compat.h
53
60
  - ruby/command-t/scanner.rb
54
61
  - ruby/command-t/scanner/buffer_scanner.rb
62
+ - ruby/command-t/scanner/command_scanner.rb
55
63
  - ruby/command-t/scanner/file_scanner.rb
56
64
  - ruby/command-t/scanner/file_scanner/find_file_scanner.rb
57
65
  - ruby/command-t/scanner/file_scanner/git_file_scanner.rb
58
66
  - ruby/command-t/scanner/file_scanner/ruby_file_scanner.rb
59
67
  - ruby/command-t/scanner/file_scanner/watchman_file_scanner.rb
68
+ - ruby/command-t/scanner/help_scanner.rb
69
+ - ruby/command-t/scanner/history_scanner.rb
60
70
  - ruby/command-t/scanner/jump_scanner.rb
71
+ - ruby/command-t/scanner/line_scanner.rb
61
72
  - ruby/command-t/scanner/mru_buffer_scanner.rb
62
73
  - ruby/command-t/scanner/tag_scanner.rb
63
74
  - ruby/command-t/scm_utilities.rb