summaryrefslogtreecommitdiff
path: root/script/workspace/workspace.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-25 17:17:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-25 17:17:18 +0800
commit9e7944e17041f573729c57b2c3b5d711c63d6e32 (patch)
tree55bff8fb32325f66b5bf6f8b07d108ed982be6f5 /script/workspace/workspace.lua
parent33580c1dd7c5ce0c9829e976cacd94418846eece (diff)
downloadlua-language-server-9e7944e17041f573729c57b2c3b5d711c63d6e32.zip
fix path
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r--script/workspace/workspace.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index f5431def..13208b75 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -320,9 +320,9 @@ function m.getRelativePath(uri)
_, pos = m.normalize(path):find(m.path, 1, true)
end
if pos then
- return m.normalize(path:sub(pos + 1))
+ return m.normalize(path:sub(pos + 1)):gsub('^[/\\]+', '')
else
- return m.normalize(path)
+ return m.normalize(path):gsub('^[/\\]+', '')
end
end