diff --git a/AUTHORS.txt b/AUTHORS.txt index 21a12db..eb31e33 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -42,6 +42,7 @@ Chris Lasher (@gotgenes) Doan Thanh Nam (@tndoan) Markus Koller (@toupeira) Justin Cheevers @justincheevers +Talha Ahmed (@talha81) @something are github user names. diff --git a/autoload/jedi.vim b/autoload/jedi.vim index 7a8aca6..46102ef 100644 --- a/autoload/jedi.vim +++ b/autoload/jedi.vim @@ -48,9 +48,15 @@ endfun function! jedi#show_documentation() Python jedi_vim.show_documentation() - if bufnr("__doc__") > 0 - " If the __doc__ buffer is open in the current window, jump to it - silent execute "sbuffer ".bufnr("__doc__") + let bn = bufnr("__doc__") + if bn > 0 + let wi=index(tabpagebuflist(tabpagenr()), bn) + if wi >= 0 + " If the __doc__ buffer is open in the current tab, jump to it + silent execute (wi+1).'wincmd w' + else + silent execute "sbuffer ".bn + endif else split '__doc__' endif