Permalink
Browse files

Fixes when trying to open the doc a non-existent module

When for the first time it is tried to open the doc of a non-existent
module, the syntax was not loaded correctly, this is fixed.

Also hide messages about the newly created buffer with `:silent'.
  • Loading branch information...
1 parent 59bcc9c commit b906f395f83ca273d804a24ca46ca880964b82f0 @jimenezrick jimenezrick committed Oct 26, 2011
Showing with 9 additions and 11 deletions.
  1. +0 −2 TODO
  2. +9 −9 ftplugin/python_pydoc.vim
View
2 TODO
@@ -1,2 +0,0 @@
-- When first try is for a word/WORD that does not have doc, then the
- syntax is not loaded correctly.
View
@@ -114,25 +114,25 @@ function s:ShowPyDoc(name, type)
" The current buffer is __doc__, so do not
" recreate nor resize it
let l:pydoc_wh = -1
- setlocal modifiable
else
if bufnr("__doc__") > 0
" If the __doc__ buffer is open in the
" current window, jump to it
- execute "sbuffer" bufnr("__doc__")
+ silent execute "sbuffer" bufnr("__doc__")
let l:pydoc_wh = -1
- setlocal modifiable
else
- execute g:pydoc_open_cmd '__doc__'
- setlocal noswapfile
- setlocal buftype=nofile
- setlocal bufhidden=delete
- setlocal filetype=python
- setlocal syntax=man
+ silent execute g:pydoc_open_cmd '__doc__'
call s:PerformMappings()
endif
endif
+ setlocal modifiable
+ setlocal noswapfile
+ setlocal buftype=nofile
+ setlocal bufhidden=delete
+ setlocal filetype=python
+ setlocal syntax=man
+
normal ggdG
" Remove function/method arguments
let s:name2 = substitute(a:name, '(.*', '', 'g' )

0 comments on commit b906f39

Please sign in to comment.