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 +4 -4
- data/plugin/vim-tags.vim +14 -13
- data/plugins.rb +4 -4
- data/vim-tags.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af854d6169f6509be11b1b535ee73027075a37396fbb8dd766ed02dc404c3b02
|
4
|
+
data.tar.gz: 34347e53833c45755d8e96ba18f00e02a49c85f46dd204006d3205e699651a95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
2
|
+
let l:project_directory = finddir('.git/..', expand('%:p:h').';')
|
3
3
|
|
4
|
-
if !empty(l:
|
5
|
-
let l:
|
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:
|
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
|
13
|
-
let l:
|
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
|
-
|
17
|
-
|
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
|
-
|
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.
|
47
|
+
gem_specs.map(&:full_gem_path).sort.join(",")
|
48
48
|
end
|
49
49
|
|
50
50
|
def gem_specs
|
data/vim-tags.gemspec
CHANGED