diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-23 17:51:54 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-23 17:51:54 +0800 |
commit | ccf21318644a8a1c409938000c195e584746761e (patch) | |
tree | 6e077b918ff34c3a2428119676d49646e2f47ecb | |
parent | d016ce4af75be43aa6dd0838b78906b8299964a9 (diff) | |
download | lua-language-server-ccf21318644a8a1c409938000c195e584746761e.zip |
fix
-rw-r--r-- | script/files.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/script/files.lua b/script/files.lua index aefdbd4a..e4729464 100644 --- a/script/files.lua +++ b/script/files.lua @@ -621,12 +621,12 @@ function m.offset(uri, position, isFinish) local start, finish, char if row > #lines then start, finish = guide.lineRange(lines, #lines) - char = utf8.len(text, start, finish, true) + char = util.utf8Len(text, start, finish) else start, finish = guide.lineRange(lines, row) char = position.character end - local utf8Len = utf8.len(text, start, finish, true) + local utf8Len = util.utf8Len(text, start, finish) local offset if char <= 0 then offset = start @@ -672,12 +672,12 @@ function m.offsetOfWord(uri, position) local start, finish, char if row > #lines then start, finish = guide.lineRange(lines, #lines) - char = utf8.len(text, start, finish, true) + char = util.utf8Len(text, start, finish) else start, finish = guide.lineRange(lines, row) char = position.character end - local utf8Len = utf8.len(text, start, finish, true) + local utf8Len = util.utf8Len(text, start, finish) local offset if char <= 0 then offset = start |