1
0
forked from VimPlug/jedi

Fix get_line_code().

Fixes #948.
This commit is contained in:
Dave Halter
2017-09-09 18:28:05 +02:00
parent ef6a1ca10f
commit 381fedddb4
2 changed files with 11 additions and 10 deletions

View File

@@ -393,9 +393,9 @@ class BaseDefinition(object):
path = self._name.get_root_context().py__file__()
lines = parser_cache[self._evaluator.grammar._hashed][path].lines
line_nr = self._name.start_pos[0]
start_line_nr = max(line_nr - before, 0)
return ''.join(lines[start_line_nr:line_nr + after + 1])
index = self._name.start_pos[0] - 1
start_index = max(index - before, 0)
return ''.join(lines[start_index:index + after + 1])
class Completion(BaseDefinition):