aboutsummaryrefslogtreecommitdiffstats
path: root/autoload
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2014-06-30 00:22:56 +0200
committerPeter Odding <peter@peterodding.com>2014-06-30 00:22:56 +0200
commit353052018cbf555c6f0b0400a47194824dcf1ea9 (patch)
tree954e88040b9bde9257d377202a76d044ee434e8b /autoload
parentf02ccb3a775d92704f6b5aef66da401f5820f039 (diff)
downloadvim-easytags-353052018cbf555c6f0b0400a47194824dcf1ea9.tar.gz
Automatically create missing directories when writing tags files
Diffstat (limited to 'autoload')
-rw-r--r--autoload/xolox/easytags/update.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/autoload/xolox/easytags/update.vim b/autoload/xolox/easytags/update.vim
index ba089e0..3706169 100644
--- a/autoload/xolox/easytags/update.vim
+++ b/autoload/xolox/easytags/update.vim
@@ -222,6 +222,11 @@ function! xolox#easytags#update#write_tagsfile(tagsfile, headers, entries) " {{{
call extend(lines, a:headers)
call extend(lines, a:entries)
endif
+ " Make sure the directory exists.
+ let directory = fnamemodify(a:tagsfile, ':h')
+ if !isdirectory(directory)
+ call mkdir(directory, 'p')
+ endif
" Write the new contents to a temporary file and atomically rename the
" temporary file into place while preserving the file's permissions.
return xolox#misc#perm#update(a:tagsfile, lines)