Skip to content

Commit

Permalink
Fix #42, some declarations made the block look like a closure
Browse files Browse the repository at this point in the history
  • Loading branch information
KristoforMaynard committed Nov 8, 2017
1 parent 8aa80c8 commit e0d4760
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion auto_docstring.py
Expand Up @@ -106,7 +106,9 @@ def find_preceding_declaration(view, defs, region):
logger.debug("block 0 is whitespace")
is_closure = True
else:
for line in block.splitlines()[1:]:
# ignore the whole declaration when determining closure-ness
block_start = len(re.search(_all_decl_re, block).group(0))
for line in block[block_start:].splitlines()[1:]:
if len(line) > 0 and line[0] not in whitespace:
logger.debug("line[0] not whitespace:", line)
is_closure = True
Expand Down

0 comments on commit e0d4760

Please sign in to comment.