From 5bec68fbf2fae6f7c197d2a155f708932aa16bd9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 1 Jun 2019 01:55:17 +1200 Subject: Just use :keepalt to avoid read-only @# --- autoload/write_mkpath.vim | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/autoload/write_mkpath.vim b/autoload/write_mkpath.vim index 6b1855d..3bcd786 100644 --- a/autoload/write_mkpath.vim +++ b/autoload/write_mkpath.vim @@ -20,14 +20,7 @@ function! write_mkpath#New(path) abort " Set filename to absolute path using :file {name}; do it silently so that " 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 + execute 'silent keepalt file '.fnameescape(getcwd().'/'.a:path) endfunction -- cgit v1.2.3