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
endtry
silent exe 'keepalt file '.tmp
silent edit!
silent exe 'keepalt file '.s:fnameescape(fn)
call delete(tmp)
if bufname('$') == tmp
silent execute 'bwipeout '.bufnr('$')
endif
silent exe 'doau BufReadPost '.s:fnameescape(fn)
try
silent edit!
finally
silent exe 'keepalt file '.s:fnameescape(fn)
call delete(tmp)
if bufname('$') == tmp
silent execute 'bwipeout '.bufnr('$')
endif
silent exe 'doau BufReadPost '.s:fnameescape(fn)
endtry
endfunction
function! s:BufReadIndex()