diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-19 15:53:42 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-19 15:53:42 +0800 |
commit | bb9920e0925aa88ca512e789a72be010404011a0 (patch) | |
tree | 9d1066a6ec2da4656a0e797baa24fb1f73d29661 /script | |
parent | 1319f05cd4de50d7b01a297f39c4ad5a839ff7be (diff) | |
download | lua-language-server-bb9920e0925aa88ca512e789a72be010404011a0.zip |
fix #790
Diffstat (limited to 'script')
-rw-r--r-- | script/filewatch.lua | 9 |
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 |