aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-01 18:26:17 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-01 18:47:48 +1200
commiteb87e294faec5c66dfac3bbe8bfa1fa35c17bdc8 (patch)
treecfe83ac8ffa57287ba1f623d30ce26717ae08666
parentMerge branch 'release/v2.0.0' (diff)
downloadvim-write-mkpath-eb87e294faec5c66dfac3bbe8bfa1fa35c17bdc8.tar.gz
vim-write-mkpath-eb87e294faec5c66dfac3bbe8bfa1fa35c17bdc8.zip
Use :file to recognise created path at end of hook
-rw-r--r--autoload/write_mkpath.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/autoload/write_mkpath.vim b/autoload/write_mkpath.vim
index 8a3ac9d..cba56e9 100644
--- a/autoload/write_mkpath.vim
+++ b/autoload/write_mkpath.vim
@@ -26,4 +26,8 @@ function! write_mkpath#(path) abort
call mkdir(dir, 'p')
endif
+ " 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 %
+
endfunction