aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
parentMerge branch 'release/v2.1.0' (diff)
downloadvim-write-mkpath-adc20852d678328fdb9efa8cbb08a5c36ebb2018.tar.gz
vim-write-mkpath-adc20852d678328fdb9efa8cbb08a5c36ebb2018.zip
Block out :file call on Windows
It raises swap file conflict warnings, and doesn't seem to be otherwise needed.
-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,