diff --git a/plugin/magit.vim b/plugin/magit.vim index 2cec897f5afd0c2082528f7dadd960005b2d9ccd..6e36896cb76b04e96df6c71116febca688a1e6cc 100644 --- a/plugin/magit.vim +++ b/plugin/magit.vim @@ -717,9 +717,9 @@ function! magit#show_magit(display, ...) if ( magit_win != 0 ) silent execute magit_win."wincmd w" elseif ( a:display == 'v' ) - silent execute "vnew " . buffer_name + silent execute "keepalt vnew " . buffer_name elseif ( a:display == 'h' ) - silent execute "new " . buffer_name + silent execute "keepalt new " . buffer_name elseif ( a:display == 'c' ) if ( !bufexists(buffer_name) ) if ( bufname("%") == "" ) @@ -836,11 +836,11 @@ endfunction function! magit#close_magit() try - close - catch /^Vim\%((\a\+)\)\=:E444/ + edit # + catch /^Vim\%((\a\+)\)\=:E\%(194\|499\)/ try - edit # - catch /^Vim\%((\a\+)\)\=:E\%(194\|499\)/ + close + catch /^Vim\%((\a\+)\)\=:E444/ quit endtry endtry