aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/xolox
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2011-09-04 13:56:11 +0200
committerPeter Odding <peter@peterodding.com>2011-09-04 13:56:11 +0200
commitf526e2b8bce040ac91a6b3e1bf7dc297f9f2ca23 (patch)
tree0b52833e3ae6867d96650dabb13f19b0a76d76ae /autoload/xolox
parent0b47a3c9589ea8276732fa2d7913cffab356ae12 (diff)
downloadvim-easytags-f526e2b8bce040ac91a6b3e1bf7dc297f9f2ca23.tar.gz
Write tags files to temporary files, then rename() into place (issue #16)
Diffstat (limited to 'autoload/xolox')
-rw-r--r--autoload/xolox/easytags.vim5
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)