path: root/autoload/write_mkpath.vim
diff options
authorTom Ryder <tom@sanctum.geek.nz>2019-06-10 18:53:20 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-10 18:53:20 +1200
commitadc20852d678328fdb9efa8cbb08a5c36ebb2018 (patch)
tree33af6e8f572377cb0d854546e38e792edd74f753 /autoload/write_mkpath.vim
parentMerge branch 'release/v2.1.0' (diff)
Block out :file call on Windows
It raises swap file conflict warnings, and doesn't seem to be otherwise needed.
Diffstat (limited to 'autoload/write_mkpath.vim')
1 files changed, 5 insertions, 2 deletions
diff --git a/autoload/write_mkpath.vim b/autoload/write_mkpath.vim
index 7610b87..2503651 100644
--- a/autoload/write_mkpath.vim
+++ b/autoload/write_mkpath.vim
@@ -30,8 +30,11 @@ function! write_mkpath#(path) abort
call mkdir(dir, 'p')
" Prod Vim into realising the buffer's directory exists now, so that a
- " subsequent change of working directory doesn't break it
- silent keepalt file %
+ " subsequent change of working directory doesn't break it; this doesn't
+ " appear to be necessary on Windows, for reasons unclear
+ if !has('win32') && !has('win64')
+ silent keepalt file %
+ endif
" Re-run the BufWritePre hooks, now that the directory exists and a useable
" filename has been set; this will start this function again from the top,