Skip to content

Commit 22bf312

Browse files
committed
Fix searching paths
1 parent ac0af82 commit 22bf312

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rplugin/python3/acid/pure/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ def path_to_ns(path, stop_paths=None):
1212
raw_path_list = None
1313

1414
for stop_path in reversed(stop_paths):
15-
m = re.search(stop_path, path)
15+
m = re.search(stop_path[::-1], path[::-1])
1616
if m:
17-
raw_path_list = path[m.start():].replace("_", "-").split('/')[stop_path.count('/') + 1:]
17+
startpos = len(path) - m.start()
18+
raw_path_list = path[startpos:].replace("_", "-").split('/')[stop_path.count('/') + 1:]
1819
raw_path_list[-1] = raw_path_list[-1].split('.')[0]
1920
break
2021

0 commit comments

Comments
 (0)