diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/workspace/require-path.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua index 963cc6d7..8e5b67dc 100644 --- a/script/workspace/require-path.lua +++ b/script/workspace/require-path.lua @@ -39,19 +39,20 @@ function m.getVisiblePath(path, searchers, strict) local isAbsolute = searcher:match '^[/\\]' or searcher:match '^%a+%:' local cutedPath = path + local currentPath = path local head local pos = 1 if not isAbsolute then if libraryPath then pos = #libraryPath + 2 else - path = workspace.getRelativePath(uri) + currentPath = workspace.getRelativePath(uri) end end repeat - cutedPath = path:sub(pos) - head = path:sub(1, pos - 1) - pos = path:match('[/\\]+()', pos) + cutedPath = currentPath:sub(pos) + head = currentPath:sub(1, pos - 1) + pos = currentPath:match('[/\\]+()', pos) if platform.OS == 'Windows' then searcher = searcher :gsub('[/\\]+', '\\') :gsub('^[/\\]+', '') |