Don't abort s:ReplaceCmd on modeline error

Partially addresses #162.
This commit is contained in:
Tim Pope
2012-03-05 07:11:13 -05:00
parent f0cb627a8e
commit 5be0c6850e

View File

@@ -1839,13 +1839,16 @@ function! s:ReplaceCmd(cmd,...) abort
endif endif
endtry endtry
silent exe 'keepalt file '.tmp silent exe 'keepalt file '.tmp
silent edit! try
silent exe 'keepalt file '.s:fnameescape(fn) silent edit!
call delete(tmp) finally
if bufname('$') == tmp silent exe 'keepalt file '.s:fnameescape(fn)
silent execute 'bwipeout '.bufnr('$') call delete(tmp)
endif if bufname('$') == tmp
silent exe 'doau BufReadPost '.s:fnameescape(fn) silent execute 'bwipeout '.bufnr('$')
endif
silent exe 'doau BufReadPost '.s:fnameescape(fn)
endtry
endfunction endfunction
function! s:BufReadIndex() function! s:BufReadIndex()