diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-06-22 19:44:45 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-06-22 19:44:45 +0800 |
commit | 4ed6db9faaa9614489b0b724a0640792cc3fc454 (patch) | |
tree | 714c01a137738176cb64434377781cf819348305 | |
parent | d98dcf00478af9d16397ab11fc5e47a24f534c04 (diff) | |
download | lua-language-server-4ed6db9faaa9614489b0b724a0640792cc3fc454.zip |
整理代码
-rw-r--r-- | script/workspace.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/script/workspace.lua b/script/workspace.lua index 88d29431..8a7e4139 100644 --- a/script/workspace.lua +++ b/script/workspace.lua @@ -201,12 +201,10 @@ end function mt:isLuaFile(path) local pathStr = path:string() for k, v in pairs(config.other.associations) do - k = k:gsub('^%*', '') - if self:fileNameEq(pathStr:sub(-#k), k) then - if v == 'lua' then + if v == 'lua' then + k = k:gsub('^%*', '') + if self:fileNameEq(pathStr:sub(-#k), k) then return true - else - return false end end end |