Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit b906f395f83ca273d804a24ca46ca880964b82f0 1 parent 59bcc9c
Ricardo Catalinas Jiménez jimenezrick authored

Showing 2 changed files with 9 additions and 11 deletions. Show diff stats Hide diff stats

  1. +0 2  TODO
  2. +9 9 ftplugin/python_pydoc.vim
2  TODO
... ... @@ -1,2 +0,0 @@
1   -- When first try is for a word/WORD that does not have doc, then the
2   - syntax is not loaded correctly.
18 ftplugin/python_pydoc.vim
@@ -114,25 +114,25 @@ function s:ShowPyDoc(name, type)
114 114 " The current buffer is __doc__, so do not
115 115 " recreate nor resize it
116 116 let l:pydoc_wh = -1
117   - setlocal modifiable
118 117 else
119 118 if bufnr("__doc__") > 0
120 119 " If the __doc__ buffer is open in the
121 120 " current window, jump to it
122   - execute "sbuffer" bufnr("__doc__")
  121 + silent execute "sbuffer" bufnr("__doc__")
123 122 let l:pydoc_wh = -1
124   - setlocal modifiable
125 123 else
126   - execute g:pydoc_open_cmd '__doc__'
127   - setlocal noswapfile
128   - setlocal buftype=nofile
129   - setlocal bufhidden=delete
130   - setlocal filetype=python
131   - setlocal syntax=man
  124 + silent execute g:pydoc_open_cmd '__doc__'
132 125 call s:PerformMappings()
133 126 endif
134 127 endif
135 128
  129 + setlocal modifiable
  130 + setlocal noswapfile
  131 + setlocal buftype=nofile
  132 + setlocal bufhidden=delete
  133 + setlocal filetype=python
  134 + setlocal syntax=man
  135 +
136 136 normal ggdG
137 137 " Remove function/method arguments
138 138 let s:name2 = substitute(a:name, '(.*', '', 'g' )

0 comments on commit b906f39

Please sign in to comment.
Something went wrong with that request. Please try again.