Skip to content

Commit 5088f01

Browse files
committed
use absolute path when set tags+=
1 parent 8472800 commit 5088f01

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

plugin/tags.vim

+9-4
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,18 @@ endfunction
114114
function s:add_tags_location(location)
115115
let location = substitute(a:location, '^\./', '', '')
116116

117-
if exists("s:locations[location]")
117+
let abs_location = fnamemodify(a:location, ":p")
118+
let tags_list = split(&tags, ',')
119+
if index(tags_list, abs_location) != -1
118120
return
119121
endif
120122

121-
silent! exe 'set tags+=' . location
122-
let s:locations[location] = 1
123-
let s:dirty_locations = 1
123+
silent! exe 'setlocal tags+=' . abs_location
124+
125+
if !exists("s:locations[location]")
126+
let s:locations[location] = 1
127+
let s:dirty_locations = 1
128+
endif
124129
endfunction
125130

126131
function! s:generate_options()

0 commit comments

Comments
 (0)