1
0
forked from VimPlug/jedi

use builtin repl completion after all, but written by us not the std lib module, which doesn't seem to work really, #280

This commit is contained in:
David Halter
2013-08-15 12:47:10 +04:30
parent 306dbf12e4
commit 9a3ea38b1c
4 changed files with 47 additions and 12 deletions

View File

@@ -95,13 +95,13 @@ class ModuleWithCursor(Module):
def __init__(self, path, source, position):
super(ModuleWithCursor, self).__init__(path, source)
self.position = position
self.source = source
self._path_until_cursor = None
# this two are only used, because there is no nonlocal in Python 2
self._line_temp = None
self._relevant_temp = None
self.source = source
@property
def parser(self):
""" get the parser lazy """
@@ -121,9 +121,10 @@ class ModuleWithCursor(Module):
def get_path_until_cursor(self):
""" Get the path under the cursor. """
result = self._get_path_until_cursor()
self._start_cursor_pos = self._start_cursor_pos_temp
return result
if self._path_until_cursor is None: # small caching
self._path_until_cursor = self._get_path_until_cursor()
self._start_cursor_pos = self._start_cursor_pos_temp
return self._path_until_cursor
def _get_path_until_cursor(self, start_pos=None):
def fetch_line():