Skip to content

Commit 3c1f169

Browse files
committed
in function, lock file path
1 parent 9997519 commit 3c1f169

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

plugin/auto-ctags.vim

+10-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,19 @@ function! s:get_ctags_path()
4040
return s:path
4141
endfunction
4242

43+
function! s:get_ctags_lock_path()
44+
let s:path = s:get_ctags_path()
45+
if len(s:path) > 0
46+
let s:path = s:path.'.lock'
47+
endif
48+
return s:path
49+
endfunction
50+
4351
function! s:get_ctags_cmd()
4452
let s:ctags_cmd = ''
4553

4654
let s:tags_name = s:get_ctags_path()
47-
let s:tags_lock_name = s:tags_name.'.lock'
55+
let s:tags_lock_name = s:get_ctags_lock_path()
4856
if len(s:tags_name) > 0 && glob(s:tags_lock_name) == ''
4957
let s:ctags_cmd = 'touch '.s:tags_lock_name.' && '
5058
\.'ctags '.g:auto_ctags_tags_args.' -f '.s:tags_name.' && '
@@ -57,7 +65,7 @@ endfunction
5765
function! s:ctags(recreate)
5866
if a:recreate > 0
5967
silent! execute '!rm '.s:get_ctags_path().' 2>/dev/null'
60-
silent! execute '!rm '.s:get_ctags_path().'.lock 2>/dev/null'
68+
silent! execute '!rm '.s:get_ctags_lock_path().' 2>/dev/null'
6169
endif
6270

6371
let s:cmd = s:get_ctags_cmd()

0 commit comments

Comments
 (0)