Browse files

Fix potential clobbering of 'tags' and 'path'

  • Loading branch information...
1 parent 85227b3 commit 0d4ae14e5ef0969048bee6f1d7ea52ed38fbd1ff @tpope tpope committed Dec 21, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 ftplugin/ruby.vim
@@ -91,9 +91,11 @@ if !exists("s:ruby_path")
-let &l:path = s:ruby_path
-if exists('s:ruby_paths')
- let &l:tags = &g:tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',')
+if stridx(&l:path, s:ruby_path) == -1
+ let &l:path = s:ruby_path
+if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val."/tags"'),',')) == -1
+ let &l:tags .= ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',')
if has("gui_win32") && !exists("b:browsefilter")

3 comments on commit 0d4ae14

This appears to be clobbering my tags setting; in my .vimrc, I have :set tags+=./tags; but when I open VIM on a file and type :set tags to see what it thinks the currently set value is, I get only the Ruby paths from line 98. This results in VIM not being able to see my tags file for my codebase. If I source my vimrc, then the tags setting has my path plus the Ruby paths. I do not run into this problem when I remove vim-ruby altogether.

Do I have something else going wrong? Or is this change not really preventing clobbering in all situations?


tpope replied Apr 26, 2012

I think you may be onto something. Could you open an issue?

Ok, Issue #78. Thanks.

Please sign in to comment.