1
0
forked from VimPlug/jedi

fix line split issues in cache

This commit is contained in:
Dave Halter
2014-04-09 13:16:28 +02:00
parent 46277eb9c9
commit d8d6b20a17
2 changed files with 8 additions and 0 deletions

View File

@@ -101,6 +101,9 @@ def cache_call_signatures(source, user_pos, stmt):
"""This function calculates the cache key."""
index = user_pos[0] - 1
lines = source.splitlines() or ['']
if source and source[-1] == '\n':
lines.append('')
before_cursor = lines[index][:user_pos[1]]
other_lines = lines[stmt.start_pos[0]:index]
whole = '\n'.join(other_lines + [before_cursor])