completely rewrote helpers.search_function_definition

This commit is contained in:
David Halter
2013-02-21 19:55:46 +04:30
parent 9fa0b9f924
commit d05018757d
4 changed files with 56 additions and 70 deletions

View File

@@ -113,8 +113,8 @@ def extract(script, new_name):
if user_stmt:
pos = script.pos
line_index = pos[0] - 1
arr, index = helpers.array_for_pos(user_stmt.get_commands(), pos)
if arr:
arr, index = helpers.array_for_pos(user_stmt, pos)
if arr is not None:
s = arr.start_pos[0], arr.start_pos[1] + 1
positions = [s] + arr.arr_el_pos + [arr.end_pos]
start_pos = positions[index]