diff options
author | Peter Odding <peter@peterodding.com> | 2011-09-04 13:56:11 +0200 |
---|---|---|
committer | Peter Odding <peter@peterodding.com> | 2011-09-04 13:56:11 +0200 |
commit | f526e2b8bce040ac91a6b3e1bf7dc297f9f2ca23 (patch) | |
tree | 0b52833e3ae6867d96650dabb13f19b0a76d76ae /autoload | |
parent | 0b47a3c9589ea8276732fa2d7913cffab356ae12 (diff) | |
download | vim-easytags-f526e2b8bce040ac91a6b3e1bf7dc297f9f2ca23.tar.gz |
Write tags files to temporary files, then rename() into place (issue #16)
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/xolox/easytags.vim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim index 4069f28..6b0a36e 100644 --- a/autoload/xolox/easytags.vim +++ b/autoload/xolox/easytags.vim @@ -3,7 +3,7 @@ " Last Change: September 4, 2011 " URL: http://peterodding.com/code/vim/easytags/ -let g:xolox#easytags#version = '2.5.2' +let g:xolox#easytags#version = '2.5.3' " Public interface through (automatic) commands. {{{1 @@ -472,7 +472,8 @@ function! xolox#easytags#write_tagsfile(tagsfile, headers, entries) " {{{2 call extend(lines, a:headers) call extend(lines, a:entries) endif - return writefile(lines, a:tagsfile) == 0 + let tempname = a:tagsfile . '.easytags.tmp' + return writefile(lines, tempname) == 0 && rename(tempname, a:tagsfile) == 0 endfunction function! s:join_entry(value) |