aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autoload/write_mkpath.vim7
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,