Vimjas / vim-python-pep8-indent

A nicer Python indentation style for vim.
Creative Commons Zero v1.0 Universal
790 stars 69 forks source link

if with parentheses gives E125 #7

Closed ichernev closed 10 years ago

ichernev commented 11 years ago

If you write

if (x == 5 and
    y == 6):
    pass

pep8 v1.4.2 gives

E125 continuation line does not distinguish itself from next logical line

When you have indent of 4 (which is standard), if ( takes 4 characters, so a line continuation would also continue at 4, and then the if body will be 4 (because the indent is 4). In order to "fix" the warning you have to indent the second line of the if statement with 8 spaces instead of 4. And I guess this should be done by the plugin :)

hynek commented 11 years ago

Yes, I personally find the 8-spaces indent ugly though. I started using:

if (
    x == 5 and
    y == 6
):
        pass

While not the high point of beauty either it feels more consistent & explicit to me.

However: If someone feels like submitting a patch, I’d be happy to merge it.

kljohann commented 10 years ago

I have a patch for this, will submit after #19 is decided on.