summaryrefslogtreecommitdiff
path: root/script-beta/workspace/workspace.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-18 15:53:10 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-18 15:53:10 +0800
commit8b060037c9fd5961f8de6b9da674d5a29a77334e (patch)
tree8f069f06af2ad9056d28cb710e50e0a480144abf /script-beta/workspace/workspace.lua
parent49f993b2cec1f51a9d9a5008c378542688ff6a3f (diff)
downloadlua-language-server-8b060037c9fd5961f8de6b9da674d5a29a77334e.zip
修改无工作目录时的细节
Diffstat (limited to 'script-beta/workspace/workspace.lua')
-rw-r--r--script-beta/workspace/workspace.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/script-beta/workspace/workspace.lua b/script-beta/workspace/workspace.lua
index ec7af5da..a4acac79 100644
--- a/script-beta/workspace/workspace.lua
+++ b/script-beta/workspace/workspace.lua
@@ -298,6 +298,9 @@ end
function m.getRelativePath(uri)
local path = furi.decode(uri)
+ if not m.path then
+ return m.normalize(path)
+ end
local _, pos = m.normalize(path):lower():find(m.path:lower(), 1, true)
if pos then
return m.normalize(path:sub(pos + 1))