1
0
forked from VimPlug/jedi

fix start_pos of multiple elements

This commit is contained in:
David Halter
2013-02-08 15:14:43 +01:00
parent 4f060ddcd9
commit 6c0a0e889c
4 changed files with 16 additions and 9 deletions

View File

@@ -190,12 +190,12 @@ class Script(object):
return scopes
def _get_under_cursor_stmt(self, cursor_txt):
r = parsing.Parser(cursor_txt, no_docstr=True)
offset = self.pos[0] - 1
r = parsing.Parser(cursor_txt, no_docstr=True, line_offset=offset)
try:
stmt = r.module.statements[0]
except IndexError:
raise NotFoundError()
stmt.start_pos = self.pos
stmt.parent = self._parser.user_scope
return stmt