Vipitis commited on
Commit
61d090a
1 Parent(s): 280eea5

Fix start index for multiline precomments

Browse files
Files changed (1) hide show
  1. utils/tree_utils.py +2 -1
utils/tree_utils.py CHANGED
@@ -94,7 +94,8 @@ def grab_before_comments(func_node):
94
  if node.start_point[0] != last_comment_line + 1:
95
  precomment = ""
96
  if node.type == "comment":
97
- start_byte = node.start_byte # reset this here to an earlier one?
 
98
  precomment += node.text.decode() + "\n"
99
  last_comment_line = node.start_point[0]
100
  elif node == func_node:
 
94
  if node.start_point[0] != last_comment_line + 1:
95
  precomment = ""
96
  if node.type == "comment":
97
+ if precomment == "":
98
+ start_byte = node.start_byte
99
  precomment += node.text.decode() + "\n"
100
  last_comment_line = node.start_point[0]
101
  elif node == func_node: