diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-01-26 16:12:57 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-01-26 16:12:57 +0800 |
commit | 863ba7697bacc427c70dad04b33e1ad76da07019 (patch) | |
tree | 76f0060ac67eaf088fe18d35dd1a571bff538ea2 /script/files.lua | |
parent | aec13d09d7e54e0032b882744abf206369c6f93a (diff) | |
download | lua-language-server-863ba7697bacc427c70dad04b33e1ad76da07019.zip |
fix
Diffstat (limited to 'script/files.lua')
-rw-r--r-- | script/files.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/script/files.lua b/script/files.lua index fd8216ca..1e7c15e9 100644 --- a/script/files.lua +++ b/script/files.lua @@ -465,13 +465,13 @@ function m.offsetOfWord(uri, position) else offset = utf8.offset(text, position.character + 1, start) or (#text + 1) end - if file._diffInfo then - offset = smerger.getOffset(file._diffInfo, offset) - end if offset > #text or text:sub(offset-1, offset):match '[%w_][^%w_]' then offset = offset - 1 end + if file._diffInfo then + offset = smerger.getOffset(file._diffInfo, offset) + end return offset end |