yasnippet-snippets icon indicating copy to clipboard operation
yasnippet-snippets copied to clipboard

Wrong indentation when using `method_docstring_numpy`.

Open yanghaoxie opened this issue 4 years ago • 6 comments

I am using Emacs 27.05. and I have

(setq python-indent-offset 4 
      python-indent-guess-indent-offset t)
  • When I expand method_docstring_numpy, I get
    def foo(self, a, b, c):
        """
        
Parameters
----------
a : 

b : 

c : 


Returns
-------
out : 

        """
        

You see that the Parameters and Returns did not indent right.

  • However, method_docstring expand right.
    def bar(self, a, b, c):
        """
        Keyword Arguments:
        a -- 
        b -- 
        c -- 
        """

yanghaoxie avatar Oct 26 '19 06:10 yanghaoxie

Works for me, I get

def foo(self, a, b, c):
    """
    
    Parameters
    ----------
    a : 

    b : 

    c : 


    Returns
    -------
    out : 

    """
    

npostavs avatar Dec 13 '19 21:12 npostavs

Can anyone tell me which settings they have to fix this? My indentation is off for both cases, I guess I am missing some setting.

JCZuurmond avatar Jul 10 '21 08:07 JCZuurmond

Mm I just tried as well and it works for me, and my Emacs configuration is just https://github.com/AndreaCrotti/Emacs-configuration/blob/master/ca-init.el @JCZuurmond Maybe you have some setting that affects this somehow?

AndreaCrotti avatar Jul 28 '21 10:07 AndreaCrotti

@AndreaCrotti : Could you be a bit more precise in pointing out which configuration settings should effect this? I do not see any off:

(setq python-indent-offset 4 
      python-indent-guess-indent-offset t

JCZuurmond avatar Jul 28 '21 11:07 JCZuurmond

Yeah that was the point @JCZuurmond I don't have any custom config at all now since I don't really use Python. So if you have a link to your config I guess it's probably something in your config that's affecting it.

AndreaCrotti avatar Jul 28 '21 11:07 AndreaCrotti

You can find it here. Thanks for helping, @AndreaCrotti!

JCZuurmond avatar Jul 28 '21 11:07 JCZuurmond