mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-18 00:15:58 +08:00
Merge pull request #273 from talha81/doc_window_reuse
Find __doc__ window if opened in current tab
This commit is contained in:
@@ -42,6 +42,7 @@ Chris Lasher (@gotgenes) <chris.lasher@gmail.com>
|
|||||||
Doan Thanh Nam (@tndoan)
|
Doan Thanh Nam (@tndoan)
|
||||||
Markus Koller (@toupeira)
|
Markus Koller (@toupeira)
|
||||||
Justin Cheevers @justincheevers
|
Justin Cheevers @justincheevers
|
||||||
|
Talha Ahmed (@talha81) <talha.ahmed@gmail.com>
|
||||||
|
|
||||||
|
|
||||||
@something are github user names.
|
@something are github user names.
|
||||||
|
|||||||
@@ -48,9 +48,15 @@ endfun
|
|||||||
function! jedi#show_documentation()
|
function! jedi#show_documentation()
|
||||||
Python jedi_vim.show_documentation()
|
Python jedi_vim.show_documentation()
|
||||||
|
|
||||||
if bufnr("__doc__") > 0
|
let bn = bufnr("__doc__")
|
||||||
" If the __doc__ buffer is open in the current window, jump to it
|
if bn > 0
|
||||||
silent execute "sbuffer ".bufnr("__doc__")
|
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
|
else
|
||||||
split '__doc__'
|
split '__doc__'
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user