Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

s:Detect: only add readable files to &tags and doc

Fixes issue #104.
  • Loading branch information...
commit 31dead6d8088dc7073d0e2645517ebc68d6de06b 1 parent cff78c3
@blueyed blueyed authored committed
Showing with 11 additions and 3 deletions.
  1. +11 −3 plugin/fugitive.vim
View
14 plugin/fugitive.vim
@@ -151,10 +151,18 @@ function! s:Detect(path)
if expand('%:p') =~# '//'
call buffer.setvar('&path', s:sub(buffer.getvar('&path'), '^\.%(,|$)', ''))
endif
- if stridx(buffer.getvar('&tags'), escape(b:git_dir.'/tags', ', ')) == -1
- call buffer.setvar('&tags', escape(b:git_dir.'/tags', ', ').','.buffer.getvar('&tags'))
+ " Look for tags file in .git dir and add them to &tags
+ " See http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html
+ let tagsfile = b:git_dir.'/tags'
+ if stridx(buffer.getvar('&tags'), escape(tagsfile, ', ')) == -1
+ if filereadable(tagsfile)
+ call buffer.setvar('&tags', escape(tagsfile, ', ').','.buffer.getvar('&tags'))
+ endif
if &filetype !=# ''
- call buffer.setvar('&tags', escape(b:git_dir.'/'.&filetype.'.tags', ', ').','.buffer.getvar('&tags'))
+ let tagsfile = b:git_dir.'/'.&filetype.'.tags'
+ if filereadable(tagsfile)
+ call buffer.setvar('&tags', escape(tagsfile, ', ').','.buffer.getvar('&tags'))
+ endif
endif
endif
endif
Please sign in to comment.
Something went wrong with that request. Please try again.