fixes for goto

This commit is contained in:
David Halter
2013-02-19 00:21:04 +04:30
parent 926ab81bf2
commit 1b7fc1ee50
3 changed files with 23 additions and 23 deletions

View File

@@ -294,7 +294,7 @@ class Script(object):
defs, search_name = evaluate.goto(stmt)
definitions = follow_inexistent_imports(defs)
if isinstance(user_stmt, pr.Statement):
if user_stmt.get_assignment_calls().start_pos > self.pos:
if user_stmt.get_commands()[0].start_pos > self.pos:
# The cursor must be after the start, otherwise the
# statement is just an assignee.
definitions = [user_stmt]

View File

@@ -1128,7 +1128,7 @@ class NamePart(str):
@property
def start_pos(self):
offset = self.parent.module.line_offset
offset = self.parent._sub_module.line_offset
return offset + self._start_pos[0], self._start_pos[1]
@property

View File

@@ -1,7 +1,7 @@
# goto command test are a different in syntax
# goto command tests are a different in syntax
definition = 3
##! 0 ['a=definition']
#! 0 ['a = definition']
a = definition
#! []
@@ -82,7 +82,7 @@ c()
#! ['module import_tree']
import import_tree
#! ['a=""']
#! ["a = ''"]
import_tree.a
#! ['module mod1']
@@ -99,7 +99,7 @@ import_tree.pkg.a
import import_tree.pkg.mod1
#! ['a = 1.0']
import_tree.pkg.mod1.a
#! ['a=""']
#! ["a = ''"]
import_tree.a
#! ['module mod1']