pydoc works now also if the cursor is on the class / created context possibility for completions (backward tokenizer)

This commit is contained in:
David Halter
2012-09-05 14:19:40 +02:00
parent 734fb5d3cf
commit a6ffae1776

View File

@@ -109,9 +109,11 @@ if 1:
vim.command('normal! K')
vim.command('return')
else:
docs = ['|Docstring of %s|\n%s' % (d, d.doc) for d in definitions]
text = ('-' * 79).join(docs)
docs = ['|Docstring for %s|\n%s' % (d, d.doc) if d.doc
else '|No Docstring for %s|' % d for d in definitions]
text = ('\n' + '-' * 79 + '\n').join(docs)
vim.command('let l:doc = %s' % repr(PythonToVimStr(text)))
vim.command('let l:doc_lines = %s' % len(text.split('\n')))
PYTHONEOF
if bufnr("__doc__") > 0
" If the __doc__ buffer is open in the current window, jump to it
@@ -119,6 +121,7 @@ PYTHONEOF
else
split '__doc__'
endif
setlocal modifiable
setlocal noswapfile
setlocal buftype=nofile
@@ -128,6 +131,11 @@ PYTHONEOF
setlocal nomodifiable
setlocal nomodified
if l:doc_lines > 20 " max 20 lines for plugin
let l:doc_lines = 20
endif
execute "resize ".l:doc_lines
" TODO more highlightings
highlight jedi_doc ctermbg=green guibg=green
match jedi_doc /^|.*|\n/