From ccf21318644a8a1c409938000c195e584746761e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 23 Jul 2021 17:51:54 +0800 Subject: fix --- script/files.lua | 8 ++++---- 1 file 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 -- cgit v1.2.3