vim-tags 0.3.0 → 0.4.0

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
  SHA256:
3
- metadata.gz: 4bc33aff0be21dfcf28ac60662708d2c0a7605bd3afe07d111006058ea3414f2
4
- data.tar.gz: 8402bf3eaa4791579010a70cb5ced680114a0b32d3f36535fbfde52189eeec10
3
+ metadata.gz: af854d6169f6509be11b1b535ee73027075a37396fbb8dd766ed02dc404c3b02
4
+ data.tar.gz: 34347e53833c45755d8e96ba18f00e02a49c85f46dd204006d3205e699651a95
5
5
  SHA512:
6
- metadata.gz: e4421652fb5563fe9ea28742d5db907477379f52be922b0fb040a7b128b1e808adbeb657743ca6cc0102b9c11b73e96ded702c7dcb1a90b7d4dade8f54d7e68d
7
- data.tar.gz: f04f668af0c693c8c6d4e4aebd0acf88e65c6921d1349d98a871689cb0476ca96f090cf7feaa511b10592121423e9f234122975ae935310164a6a9ceaa109c08
6
+ metadata.gz: 4a6434f574211fedc99ed2a55031e89c149248cc27d4f4caec72ad2fe57cd9fb4387c0a14b99a5ac67c032dbbd62e23baaf8228a2bf2d19df5ee25b735423243
7
+ data.tar.gz: 4807c99ae48b3569f92d2bad49e8f53aace4c13dc80e66a8407d7a2a6b723557f854576704c91aafdd32cf587e3ef730625f8a4e0d73e1c9600d3dd8bd8f068c
data/plugin/vim-tags.vim CHANGED
@@ -1,24 +1,25 @@
1
1
  function! LoadRubyTags()
2
- let l:load_ruby_tags_dir = finddir('.git/..', expand('%:p:h').';')
2
+ let l:project_directory = finddir('.git/..', expand('%:p:h').';')
3
3
 
4
- if !empty(l:load_ruby_tags_dir)
5
- let l:load_ruby_tags_gem_tags_path = l:load_ruby_tags_dir . '/.bundle/.gem_tag_files'
4
+ if !empty(l:project_directory)
5
+ let l:gem_tag_files_path = l:project_directory . '/.bundle/.gem_tag_files'
6
6
 
7
- if !filereadable(l:load_ruby_tags_gem_tags_path)
7
+ if !filereadable(l:gem_tag_files_path)
8
8
  let l:install_response = system('bundler plugin install vim-tags')
9
9
  let l:command_response = system('bundler vim-tags')
10
10
  endif
11
11
 
12
- let g:gem_files = json_decode(readfile(l:load_ruby_tags_gem_tags_path))
13
- let l:gem_comma_tags = join(values(g:gem_files), "/tags,") . '/tags'
14
- let l:ruby_comma_tags = join(readfile(l:load_ruby_tags_dir . '/.bundle/.ruby_tag_files'), "/tags,") . '/tags'
12
+ let l:gems = json_decode(readfile(l:gem_tag_files_path))
13
+ let l:ruby = json_decode(readfile(l:project_directory . '/.bundle/.ruby_tag_files'))
15
14
 
16
- setlocal includeexpr=get(g:gem_files,v:fname,v:fname)
17
- setlocal suffixesadd=/
18
- cnoremap <buffer><expr> <Plug><cfile> get(g:gem_files,expand("<cfile>"),"\022\006")
19
-
20
- let &l:tags = &tags . ',' . l:gem_comma_tags . ',' . l:ruby_comma_tags
15
+ let &l:tags = &tags . ',' . l:gems['tags'] . ',' . l:ruby['tags']
16
+ let &l:path = &path . ',' . l:gems['paths'] . ',' . l:ruby['paths']
21
17
  endif
22
18
  endfunction
23
19
 
24
- autocmd FileType ruby :call LoadRubyTags()
20
+ augroup rubypath
21
+ autocmd!
22
+ autocmd FileType ruby setlocal suffixesadd+=.rb
23
+
24
+ autocmd FileType ruby :call LoadRubyTags()
25
+ augroup END
data/plugins.rb CHANGED
@@ -25,12 +25,12 @@ class VimTagsCommand < Bundler::Plugin::API
25
25
  write_to_file(
26
26
  File.join(Bundler.app_config_path, ".ruby_tag_files"),
27
27
  "Writing ruby tag cache to",
28
- { tags: ruby_tags, paths: $: }
28
+ { tags: ruby_tags, paths: $:.join(",") }
29
29
  )
30
30
  end
31
31
 
32
32
  def ruby_tags
33
- $:.select { |path| File.exist?(File.join(path, "tags")) }
33
+ $:.select { |path| File.exist?(File.join(path, "tags")) }.join(",")
34
34
  end
35
35
 
36
36
  def gem_tags
@@ -40,11 +40,11 @@ class VimTagsCommand < Bundler::Plugin::API
40
40
  next unless File.exist?(tag_path)
41
41
 
42
42
  tag_path
43
- end
43
+ end.sort.join(",")
44
44
  end
45
45
 
46
46
  def gem_paths
47
- gem_specs.to_h { |spec| [spec.name, spec.full_gem_path] }
47
+ gem_specs.map(&:full_gem_path).sort.join(",")
48
48
  end
49
49
 
50
50
  def gem_specs
data/vim-tags.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "vim-tags"
5
- spec.version = "0.3.0"
5
+ spec.version = "0.4.0"
6
6
  spec.authors = ["Nick Pezza"]
7
7
  spec.email = ["pezza@hey.com"]
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vim-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Pezza