From 441ddd1ef80d4c8285c32d78bb53f3194822f45e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 1 Jun 2019 01:02:17 +1200 Subject: Clean up alternate file buffer on :file --- autoload/write_mkpath.vim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/autoload/write_mkpath.vim b/autoload/write_mkpath.vim index bfe45bd..6b1855d 100644 --- a/autoload/write_mkpath.vim +++ b/autoload/write_mkpath.vim @@ -18,9 +18,17 @@ function! write_mkpath#New(path) abort endif " Set filename to absolute path using :file {name}; do it silently so that - " the nice name remains displayed to the user + " the nice name remains displayed to the user. Record the name of the + " alternate buffer first, so we can put it back after :file messes with it. + let alt = @# execute 'silent file '.fnameescape(getcwd().'/'.a:path) + " That :file command will have set the alternate buffer to an unlisted + " buffer of the same name, which we don't want. Wipe it, and restore the + " previous alternative buffer. + bwipe # + let @# = alt + endfunction " Handle a :write operation; prompt for directory creation if needed with -- cgit v1.2.3 From bbaa0ff302a5346c638e78030f0a44470a678f7b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 1 Jun 2019 01:03:14 +1200 Subject: Bump VERSION --- VERSION | 2 +- doc/write_mkpath.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 3eefcb9..9084fa2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 +1.1.0 diff --git a/doc/write_mkpath.txt b/doc/write_mkpath.txt index db490f7..3416629 100644 --- a/doc/write_mkpath.txt +++ b/doc/write_mkpath.txt @@ -1,4 +1,4 @@ -*write_mkpath.txt* For Vim version 7.0 Last change: 2019 May 31 +*write_mkpath.txt* For Vim version 7.0 Last change: 2019 Jun 01 DESCRIPTION *write_mkpath* -- cgit v1.2.3