heavenshell / vim-pydocstring

Generate Python docstring to your Python source code.
BSD 3-Clause "New" or "Revised" License
337 stars 53 forks source link

docstring placement depends on whether there is a line after the function declaration. #5

Closed nye17 closed 10 years ago

nye17 commented 10 years ago

I sometimes trigger vim-docstring right after typing the function declaration, i.e., with just one line of

def foo(a):

in this case, the plugin will place the docstring generated on top of the line rather than below. Is this deliberate or a bug?

Funny thing is, I first found this when I was adding docstring for my init function inside a class, and the placement happened to be exactly what I want --- doc right below

class foo(object):

rather than below

def __init___(self):

which is one indentation level lower.

So if possible, I'd be happy to see this feature kept....Thanks.

heavenshell commented 10 years ago

in this case, the plugin will place the docstring generated on top of the line rather than below. Is this deliberate or a bug?

Reproduced. Docstring should generate below def line. This is a bug. I'll fix it.

Thanks for reporting this problem.

heavenshell commented 10 years ago

Hey, I fixed this issue. Could you try master branch?

nye17 commented 10 years ago

sorry for the late reply. it works, thanks!

On Dec 13, 2013, at 8:06 PM, heavenshell notifications@github.com wrote:

Hey, I fixed this issue. Could you try master branch?

— Reply to this email directly or view it on GitHub.

heavenshell commented 10 years ago

Great, thanks for your contribution! :+1: