fgallina/python.el — Issue #61: end-of-defun failes when comment is not indented correctly
Author: lins05
Created: 2011-12-21 05:06:53+00:00
State: open

It's fine for comments which are indented as code:

def ff(x):
if x == 1:
# x is 1
print(1)
else:
print('not', 1)

But if the comment line is not correctly indented, like this:

def ff(x):
if x == 1:
# x is 1
print(1)
else:
print('not', 1)

Then the cursor will stop at the line below the comment line

I guess the mechanism behind begin/end-of-defun is to count indention to decide the current def/class scope, and it fails to tell whether it's a silly indented comment or really the end of def/class definition.