heavenshell / vim-pydocstring

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

indent doesn't work with return_type #51

Closed JPFrancoia closed 6 years ago

JPFrancoia commented 6 years ago

I'm trying to make a template for Google style doc string. Here is my multi.txt:

"""{{_header_}}

{{_indent_}}Args:
{{_nested_indent_}}{{_args_}}:

{{_indent_}}Returns:
{{_return_type_}}
"""

It produces this:

    def my_func(self, nbr: int, word: str) -> bool:
        """my_func

        Args:
            nbr (int):
            word (str):

        Returns:
        bool
        """

Note that the return type is not indented (expected behaviour). Now I try to indent it:

multi.txt:

"""{{_header_}}

{{_indent_}}Args:
{{_nested_indent_}}{{_args_}}:

{{_indent_}}Returns:
{{_nested_indent_}}{{_return_type_}}
"""
    def my_func(self, nbr: int, word: str) -> bool:
        """my_func

        Args:
            nbr (int):
            word (str):

        Returns:
        {{_nested_indent_}}bool
        """

The placeholder appears in the code. Same result with the indent placeholder.

heavenshell commented 6 years ago

Fixed. Release as 0.6.0.

JPFrancoia commented 6 years ago

Thanks!