Skip to content Skip to sidebar Skip to footer

Python Docstring With Vim Pythoncomplete Is Not Displaying Newlines For My Own Class Functions

I am getting some unexpected results when trying to use Python Omni Completion on my own class functions. The docstring for the functions are not getting formatted correctly with l

Solution 1:

Edit: I wrote an autocompletion, which should is much better than pythoncomplete: https://github.com/davidhalter/jedi-vim


The Python Omni Completion of vim is pretty stupid. It's a simple script which parses the current file and imports all the others. This is pretty dangerous and shouldn't be done. However it works not that bad (but also not good at all).

So really the difference between your two scenarios is, that the standard libraries are being imported. So are your files, but not the current file. If you used a second module named test2 and used:

import test
test.mydoc.prettyStr

It should work.

Your current file is being parsed. The parser is simple and not really good. The dostring parser is especially strange because of this line (line number ~290):

docstr = docstr.replace('\n', ' ')

You can modify it - just change this file: /usr/share/vim/vim73/autoload/pythoncomplete.vim Maybe it's in a different directory.

Currently I'm in the process of writing a better autocompletion for python/vi (this is also the reason why I know this). But that's still quite some work. I hope I'll be ready with a Beta in a month. I try to keep you posted.

Post a Comment for "Python Docstring With Vim Pythoncomplete Is Not Displaying Newlines For My Own Class Functions"