summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-11-19 15:53:42 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-11-19 15:53:42 +0800
commitbb9920e0925aa88ca512e789a72be010404011a0 (patch)
tree9d1066a6ec2da4656a0e797baa24fb1f73d29661 /script
parent1319f05cd4de50d7b01a297f39c4ad5a839ff7be (diff)
downloadlua-language-server-bb9920e0925aa88ca512e789a72be010404011a0.zip
fix #790
Diffstat (limited to 'script')
-rw-r--r--script/filewatch.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/script/filewatch.lua b/script/filewatch.lua
index 17a0548b..e2050dd9 100644
--- a/script/filewatch.lua
+++ b/script/filewatch.lua
@@ -8,11 +8,14 @@ local RENAME = 1 << 1
local function exists(filename)
local path = fs.path(filename)
local suc, res = pcall(fs.exists, path)
- if suc and res then
- return true
- else
+ if not suc or not res then
return false
end
+ suc, res = pcall(fs.canonical, path)
+ if not suc or res:string() ~= path:string() then
+ return false
+ end
+ return true
end
---@class filewatch