command-t 1.12 → 1.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d28350a8f515cb7471b5fa00a9074b0721b6c30
4
- data.tar.gz: 246ebc958cfc16da936f2a71c72414505e8bd159
3
+ metadata.gz: 46092d285a715fa372926a9ba7a6c9c52fd3bd83
4
+ data.tar.gz: 6cbb54f1c5e3be27a255812b04d82119bc179a21
5
5
  SHA512:
6
- metadata.gz: 694364fc9b561d94529c0bebb1e02491b641b9fefb0cb02f942268affea2672ea6776f8b8b1074ca15d9d3fe09a7696f8d7d7a9cd1062c686ebdb61967a1a96c
7
- data.tar.gz: cf34b852f36ef42b54b29e70ce2e9e30949a598a28fce5ab16aaa9b29068eef222df4412a3107490d678d298e5dff522327727e617b79f3cb698349ae6571898
6
+ metadata.gz: 370557a99ef3c9410797bf1abb003ede91f1e6c4177ea7ef811fcbf7c0ed4be846a6f0c01ea7125cce29aa7b8866dc9185e784b0ccce0a55277ae73c80ec3504
7
+ data.tar.gz: a0d3d1e129b3de1620947edd09bf22baab78219484f180b933e4dbcd65351b70ff75c3c006abce461b7e92805a1ad9a257d4b15b07a7f7ffadd45b796ac2fd06
data/README.txt CHANGED
@@ -1291,6 +1291,12 @@ POSSIBILITY OF SUCH DAMAGE.
1291
1291
 
1292
1292
  HISTORY *command-t-history*
1293
1293
 
1294
+ 1.13 (29 April 2015)
1295
+
1296
+ - avoid "W10: Warning: Changing a readonly file" when starting Vim in
1297
+ read-only mode (ie. as `view` or with the `-R` option)
1298
+ - fix infinite loop on |<Tab>| (regression introduced in 1.12)
1299
+
1294
1300
  1.12 (9 April 2015)
1295
1301
 
1296
1302
  - add |:CommandTLoad| command
data/doc/command-t.txt CHANGED
@@ -1291,6 +1291,12 @@ POSSIBILITY OF SUCH DAMAGE.
1291
1291
 
1292
1292
  HISTORY *command-t-history*
1293
1293
 
1294
+ 1.13 (29 April 2015)
1295
+
1296
+ - avoid "W10: Warning: Changing a readonly file" when starting Vim in
1297
+ read-only mode (ie. as `view` or with the `-R` option)
1298
+ - fix infinite loop on |<Tab>| (regression introduced in 1.12)
1299
+
1294
1300
  1.12 (9 April 2015)
1295
1301
 
1296
1302
  - add |:CommandTLoad| command
data/plugin/command-t.vim CHANGED
@@ -1,7 +1,7 @@
1
- " Copyright 2010-2014 Greg Hurrell. All rights reserved.
1
+ " Copyright 2010-2015 Greg Hurrell. All rights reserved.
2
2
  " Licensed under the terms of the BSD 2-clause license.
3
3
 
4
- if exists("g:command_t_loaded") || &cp
4
+ if exists('g:command_t_loaded') || &cp
5
5
  finish
6
6
  endif
7
7
  let g:command_t_loaded = 1
@@ -14,10 +14,10 @@ command! -nargs=? -complete=dir CommandT call commandt#CommandTShowFileFinder(<q
14
14
  command! CommandTFlush call commandt#CommandTFlush()
15
15
  command! CommandTLoad call commandt#CommandTLoad()
16
16
 
17
- if !hasmapto(':CommandT<CR>') && maparg('<Leader>t', 'n') == ''
17
+ if !hasmapto(':CommandT<CR>') && maparg('<Leader>t', 'n') ==# ''
18
18
  silent! nnoremap <unique> <silent> <Leader>t :CommandT<CR>
19
19
  endif
20
20
 
21
- if !hasmapto(':CommandTBuffer<CR>') && maparg('<Leader>b', 'n') == ''
21
+ if !hasmapto(':CommandTBuffer<CR>') && maparg('<Leader>b', 'n') ==# ''
22
22
  silent! nnoremap <unique> <silent> <Leader>b :CommandTBuffer<CR>
23
23
  endif
data/ruby/command-t.rb CHANGED
@@ -1,9 +1,10 @@
1
- # Copyright 2014 Greg Hurrell. All rights reserved.
1
+ # Copyright 2014-2015 Greg Hurrell. All rights reserved.
2
2
  # Licensed under the terms of the BSD 2-clause license.
3
3
 
4
4
  module CommandT
5
5
  autoload :Controller, 'command-t/controller'
6
6
  autoload :Finder, 'command-t/finder'
7
+ autoload :Metadata, 'command-t/metadata'
7
8
  autoload :MRU, 'command-t/mru'
8
9
  autoload :MatchWindow, 'command-t/match_window'
9
10
  autoload :PathUtilities, 'command-t/path_utilities'
@@ -202,7 +202,7 @@ module CommandT
202
202
  def cancel
203
203
  hide
204
204
  end
205
- guard :toggle_focus
205
+ guard :cancel
206
206
 
207
207
  def select_next
208
208
  @match_window.select_next
Binary file
@@ -1,6 +1,8 @@
1
- # Copyright 2010-2014 Greg Hurrell. All rights reserved.
1
+ # Copyright 2010-2015 Greg Hurrell. All rights reserved.
2
2
  # Licensed under the terms of the BSD 2-clause license.
3
3
 
4
+ require 'pathname'
5
+
4
6
  begin
5
7
  require 'mkmf'
6
8
  rescue LoadError
@@ -45,3 +47,20 @@ end
45
47
  RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
46
48
 
47
49
  create_makefile('ext')
50
+
51
+ # Create `metadata.rb`, which is used to diagnose installation problems.
52
+ basedir = Pathname.new(__FILE__).dirname
53
+ (basedir + 'metadata.rb').open('w') do |f|
54
+ f.puts <<-END.gsub(/^ /, '')
55
+ # This file was generated by #{(basedir + 'extconf.rb').to_s}
56
+ module CommandT
57
+ module Metadata
58
+ EXPECTED_RUBY_VERSION = #{RUBY_VERSION.inspect}
59
+ EXPECTED_RUBY_PATCHLEVEL = #{
60
+ defined?(RUBY_PATCHLEVEL) ? RUBY_PATCHLEVEL.inspect : nil.inspect
61
+ }
62
+ UNKNOWN = false
63
+ end # module Metadata
64
+ end # module CommandT
65
+ END
66
+ end
@@ -52,6 +52,7 @@ module CommandT
52
52
  set 'bufhidden', 'unload' # unload buf when no longer displayed
53
53
  set 'buftype', 'nofile' # buffer is not related to any file
54
54
  set 'modifiable', false # prevent manual edits
55
+ set 'readonly', false # avoid W10 "Changing a readonly file"
55
56
  set 'swapfile', false # don't create a swapfile
56
57
  set 'wrap', false # don't soft-wrap
57
58
  set 'number', false # don't show line numbers
@@ -0,0 +1,8 @@
1
+ # This file was generated by extconf.rb
2
+ module CommandT
3
+ module Metadata
4
+ EXPECTED_RUBY_VERSION = "2.0.0"
5
+ EXPECTED_RUBY_PATCHLEVEL = 481
6
+ UNKNOWN = false
7
+ end # module Metadata
8
+ end # module CommandT
@@ -18,10 +18,10 @@ module CommandT
18
18
  WatchmanError = Class.new(::RuntimeError)
19
19
 
20
20
  def paths!
21
- sockname = Watchman::Utils.load(
22
- %x{watchman --output-encoding=bser get-sockname}
23
- )['sockname']
24
- raise WatchmanError, 'get-sockname failed' unless $?.exitstatus.zero?
21
+ sockname = extract_value(
22
+ Watchman::Utils.load(get_raw_sockname),
23
+ 'sockname'
24
+ )
25
25
 
26
26
  UNIXSocket.open(sockname) do |socket|
27
27
  root = Pathname.new(@path).realpath.to_s
@@ -32,7 +32,7 @@ module CommandT
32
32
 
33
33
  # root_restrict_files setting may prevent Watchman from working
34
34
  # or enforce_root_files/root_files (>= version 3.1)
35
- raise WatchmanError, result['error'] if result.has_key?('error')
35
+ extract_value(result)
36
36
  end
37
37
 
38
38
  query = ['query', root, {
@@ -42,14 +42,25 @@ module CommandT
42
42
  paths = Watchman::Utils.query(query, socket)
43
43
 
44
44
  # could return error if watch is removed
45
- raise WatchmanError, paths['error'] if paths.has_key?('error')
46
-
47
- paths['files']
45
+ extract_value(paths, 'files')
48
46
  end
49
47
  rescue Errno::ENOENT, WatchmanError
50
48
  # watchman executable not present, or unable to fulfil request
51
49
  super
52
50
  end
51
+
52
+ private
53
+
54
+ def extract_value(object, key = nil)
55
+ raise WatchmanError, object['error'] if object.has_key?('error')
56
+ object[key]
57
+ end
58
+
59
+ def get_raw_sockname
60
+ raw_sockname = %x{watchman --output-encoding=bser get-sockname}
61
+ raise WatchmanError, 'get-sockname failed' if !$?.exitstatus.zero?
62
+ raw_sockname
63
+ end
53
64
  end # class WatchmanFileScanner
54
65
  end # class FileScanner
55
66
  end # class Scanner
@@ -33,6 +33,7 @@ module CommandT
33
33
  list
34
34
  modifiable
35
35
  number
36
+ readonly
36
37
  relativenumber
37
38
  spell
38
39
  swapfile
@@ -3,10 +3,13 @@
3
3
 
4
4
  module CommandT
5
5
  class Stub
6
+ @@expected_version = Metadata::EXPECTED_RUBY_VERSION
7
+ @@expected_patchlevel = Metadata::EXPECTED_RUBY_PATCHLEVEL
6
8
  @@patch_level = defined?(RUBY_PATCHLEVEL) ? RUBY_PATCHLEVEL : '[unknown]'
7
9
  @@load_error = ['command-t.vim could not load the C extension',
8
10
  'Please see INSTALLATION and TROUBLE-SHOOTING in the help',
9
11
  "Vim Ruby version: #{RUBY_VERSION}-p#{@@patch_level}",
12
+ "Expected version: #{@@expected_version}-p#{@@expected_patchlevel}",
10
13
  'For more information type: :help command-t']
11
14
 
12
15
  [
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.12'
4
+ version: '1.13'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Hurrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-10 00:00:00.000000000 Z
11
+ date: 2015-04-29 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
@@ -43,6 +43,7 @@ files:
43
43
  - ruby/command-t/match_window.rb
44
44
  - ruby/command-t/matcher.c
45
45
  - ruby/command-t/matcher.h
46
+ - ruby/command-t/metadata.rb
46
47
  - ruby/command-t/mru.rb
47
48
  - ruby/command-t/path_utilities.rb
48
49
  - ruby/command-t/prompt.rb