summaryrefslogtreecommitdiff
path: root/script/workspace/workspace.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-23 12:53:21 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-23 12:53:21 +0800
commita61130247e35c6e33adcd64b3361a91390a4d4e9 (patch)
treeb7ded1777875d332ca062e48591027a01eee7e72 /script/workspace/workspace.lua
parentad192cc99096f717b1a59f8f8bc7b0dac0230a4e (diff)
downloadlua-language-server-a61130247e35c6e33adcd64b3361a91390a4d4e9.zip
check Windows
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r--script/workspace/workspace.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index cfc94012..f96d88eb 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -304,7 +304,12 @@ function m.getRelativePath(uri)
if not m.path then
return m.normalize(path)
end
- local _, pos = m.normalize(path):lower():find(m.path:lower(), 1, true)
+ local _, pos
+ if platform.OS == 'Windows' then
+ _, pos = m.normalize(path):lower():find(m.path:lower(), 1, true)
+ else
+ _, pos = m.normalize(path):find(m.path, 1, true)
+ end
if pos then
return m.normalize(path:sub(pos + 1))
else