1
0
forked from VimPlug/jedi

make source_path in script optional, fixes #32

This commit is contained in:
David Halter
2012-10-20 13:45:15 +02:00
parent 95481be64c
commit bb76792ea8
6 changed files with 16 additions and 9 deletions

View File

@@ -40,7 +40,7 @@ class ModuleWithCursor(Module):
be there.
:param source: The source code of the file.
:param path: The module path of the file.
:param path: The module path of the file or None.
:param position: The position, the user is currently in. Only important \
for the main file.
"""
@@ -62,7 +62,8 @@ class ModuleWithCursor(Module):
# Also, the position is here important (which will not be used by
# default), therefore fill the cache here.
self._parser = parsing.PyFuzzyParser(source, path, position)
builtin.CachedModule.cache[self.path] = time.time(), self._parser
if self.path:
builtin.CachedModule.cache[self.path] = time.time(), self._parser
def get_path_until_cursor(self):
""" Get the path under the cursor. """