diff options
author | Tommy Allen <tommy@esdf.io> | 2016-10-27 10:14:07 -0400 |
---|---|---|
committer | Tommy Allen <tommy@esdf.io> | 2016-10-27 10:14:07 -0400 |
commit | c3162dc46588770d652259c9bd6740ae65210b96 (patch) | |
tree | a736cca044e7c8ae1de1068ac2a547f46b42c328 /rplugin | |
parent | 775b03bbc6887654b26aef7d724f4fbf519becfd (diff) | |
download | deoplete.nvim-c3162dc46588770d652259c9bd6740ae65210b96.zip |
Fix relative path pattern
Fixes #364
Diffstat (limited to 'rplugin')
-rw-r--r-- | rplugin/python3/deoplete/source/file.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rplugin/python3/deoplete/source/file.py b/rplugin/python3/deoplete/source/file.py index 4ffc04e..79b14c3 100644 --- a/rplugin/python3/deoplete/source/file.py +++ b/rplugin/python3/deoplete/source/file.py @@ -58,7 +58,8 @@ class Source(Base): ] + [{'word': x} for x in files] def __longest_path_that_exists(self, context, input_str): - data = re.split(r'(%s+)' % self.__isfname, input_str) + data = re.split(r'((?:%s+|(?:(?<![\w\s/\.])(?:~|\.{1,2})?/)+))' % + self.__isfname, input_str) data = [''.join(data[i:]) for i in range(len(data))] existing_paths = sorted(filter(lambda x: exists( dirname(self.__substitute_path(context, x))), data)) @@ -74,6 +75,5 @@ class Source(Base): for _ in m.group(1): base = dirname(base) - path = os.path.abspath(os.path.join(base, path[len(m.group(0)):])) - return path + return os.path.abspath(os.path.join(base, path[len(m.group(0)):])) return expand(path) |