Skip to content

Commit f526e2b

Browse files
committed
Write tags files to temporary files, then rename() into place (issue #16)
1 parent 0b47a3c commit f526e2b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

autoload/xolox/easytags.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Last Change: September 4, 2011
44
" URL: http://peterodding.com/code/vim/easytags/
55

6-
let g:xolox#easytags#version = '2.5.2'
6+
let g:xolox#easytags#version = '2.5.3'
77

88
" Public interface through (automatic) commands. {{{1
99

@@ -472,7 +472,8 @@ function! xolox#easytags#write_tagsfile(tagsfile, headers, entries) " {{{2
472472
call extend(lines, a:headers)
473473
call extend(lines, a:entries)
474474
endif
475-
return writefile(lines, a:tagsfile) == 0
475+
let tempname = a:tagsfile . '.easytags.tmp'
476+
return writefile(lines, tempname) == 0 && rename(tempname, a:tagsfile) == 0
476477
endfunction
477478

478479
function! s:join_entry(value)

0 commit comments

Comments
 (0)