Better completions in comments.

This commit is contained in:
Dave Halter
2016-07-25 09:58:04 +02:00
parent 6ed864f032
commit 2d544c51c6
3 changed files with 38 additions and 9 deletions

View File

@@ -550,6 +550,10 @@ class BaseNode(Base):
try:
return c.get_leaf_for_position(position, include_prefixes)
except AttributeError:
while c.type in ('indent', 'dedent'):
# We'd rather not have indents and dedents as a leaf,
# because they don't contain indentation information.
c = c.get_next_leaf()
return c
return None