diff --git a/plugin/magit.vim b/plugin/magit.vim index b2015195ad20f0c568dc7abc7934e9db7255e301..55bc4ed63e23b49f1434a9de6576074a516cb012 100644 --- a/plugin/magit.vim +++ b/plugin/magit.vim @@ -1314,7 +1314,11 @@ function! magit#jump_to() endif try - execute "edit " . "+" . line_in_file . " " filename + if ( bufexists(filename) ) + execute "buffer " . "+" . line_in_file . " " filename + else + execute "edit " . "+" . line_in_file . " " filename + endif catch if ( v:exception == 'Vim:Interrupt' && buf_win == 0) close