heavenshell / vim-pydocstring

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

Indentation problem #20

Closed nipunsadvilkar closed 7 years ago

nipunsadvilkar commented 7 years ago

with and without autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab results are like this only:

def foo(a, b, c):
    """foo

        :param a:
            :param b:
                :param c:
                    """

Input from anyone would be helpful.

heavenshell commented 7 years ago

Strange. My setting is exactly same as you.

autocmd FileType python,php,perl,java,c setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
def foo(a, b, c):
    """foo

    :param a:
    :param b:
    :param c:
    """
    pass

Can you show me following command output?

:verbose set tabletop

My output is

  tabstop=4
        Last set from ~/.vimrc
nipunsadvilkar commented 7 years ago

@heavenshell : you mean :verbose set tabstop right?

My output is:

  tabstop=4                                                                                                                                             
        Last set from ~/.space-vim/layers/+lang/python/config.vim 
heavenshell commented 7 years ago

ah, typo 😰 Thx.

hmm,

autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expand tab

was written at ~/.space-vim/layers/+lang/python/config.vim?

what about another shiftwidth, softtabstop, expandtab?

nipunsadvilkar commented 7 years ago

Yes, all are set there only. Attaching screenshot for reference: space_vim

heavenshell commented 7 years ago

Thx. Humm, I don't know about SpaceVim or space-vim behavior.

Anyway if you open new python file and type like following,

idef<SPACE>foo(a,<SPACE>b,<SPACE>c):<ESC><CR><TAB>pass

it would be like following?

def foo(a, b, c):
    pass

before pass there are 4 byte space?

nipunsadvilkar commented 7 years ago

Tried.. problem persists :cry:

heavenshell commented 7 years ago

Strange... I can't reproduce. pydocstring's indent depend on softtabstop.

What if you disabled python-mode indention. https://github.com/liuchengxu/space-vim/blob/master/layers/%2Blang/python/config.vim#L45

nipunsadvilkar commented 7 years ago

Good suggestion..Thanks but not working...:(

heavenshell commented 7 years ago

Is there anything about indent plugins?

What about if you don't use space-vim things. Just use plan Vim(latest version is also good) and pydocstrings.vim only.

heavenshell commented 7 years ago

Can't reproduce this.