Skip to content

Commit 0d4ae14

Browse files
committed
Fix potential clobbering of 'tags' and 'path'
1 parent 85227b3 commit 0d4ae14

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ftplugin/ruby.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ if !exists("s:ruby_path")
9191
endif
9292
endif
9393

94-
let &l:path = s:ruby_path
95-
if exists('s:ruby_paths')
96-
let &l:tags = &g:tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',')
94+
if stridx(&l:path, s:ruby_path) == -1
95+
let &l:path = s:ruby_path
96+
endif
97+
if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val."/tags"'),',')) == -1
98+
let &l:tags .= ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',')
9799
endif
98100

99101
if has("gui_win32") && !exists("b:browsefilter")

0 commit comments

Comments
 (0)