Try to wipe out temp buffer from :read

Also try to preserve marks.
This commit is contained in:
Tim Pope
2020-01-26 10:37:34 -05:00
parent 40872a9555
commit d926e3beb4

View File

@@ -1593,9 +1593,12 @@ function! s:ReplaceCmd(cmd) abort
if exec_error if exec_error
call s:throw((len(err) ? err : filereadable(temp) ? join(readfile(temp), ' ') : 'unknown error running ' . a:cmd)) call s:throw((len(err) ? err : filereadable(temp) ? join(readfile(temp), ' ') : 'unknown error running ' . a:cmd))
endif endif
silent exe 'keepalt $read ++edit' s:fnameescape(temp) silent exe 'lockmarks keepalt 0read ++edit' s:fnameescape(temp)
silent keepjumps 1delete _ silent keepjumps $delete _
call delete(temp) call delete(temp)
if s:cpath(fnamemodify(bufname('$'), ':p'), temp)
silent! execute bufnr('$') . 'bwipeout'
endif
endfunction endfunction
function! s:QueryLog(refspec) abort function! s:QueryLog(refspec) abort