Comment 11 for bug 939577

Revision history for this message
Ryan Kaskel (ryankaskel) wrote :

Hi Andreas,

I'm reopening this issue because I'm not sure if I communicated the original bug report correctly.

If I type in emacs with python-mode on:

if True:
    x = 1
    if x:
        y = 2
        if y:
                z = 3
                ^
                 |------------ python-mode indents 8 spaces instead of four.

Each type I pressed RET after a colon (":"), the cursor indented four spaces.

The third time I pressed RET after an if statement (although this happens after all blocks), the cursor moved 8 spaces.

if True: # pressing RET here will move the cursor 4 spaces from column 0
    if True: # pressing RET here will move the cursor 8 spaces from column 0
        if True: # pressing RET here will move the cursor *16* spaces from column 0; this doesn't make sense
                if True: # pressing RET here will move the cursor 20 spaces from column 0
                    pass

Notice the indentation pattern is 4 - 8 - 16 - 20; it should be 4 - 8 - 12 -16.

I completely agree that people should be able to code however they like, but there is a bug in the current behavior.