On 2017-01-21 Sat 09:34 GMT-0800, Matthew Woodcraft wrote: > > I have tested this patch and it does fix the case I posted. > > But it misbehaves if I add a blank line before the 'else': > > def foo() > if aaa: > if bbb: > x = 1 > y = 1 > > else > > Now when I add the colon after the 'else', electric-indent moves the > 'else' to align with the 'def'. > > > I agree that python-info-dedenter-opening-block-positions is the right > thing to fix. > > I think it's sufficient to look at the last nonblank line above the > current line, rather than all lines between the candidate opening block > and the current line. > > -M- Thanks for your suggestion, Matthew. I've now fixed it in the new patch as attached.