diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-12-18 22:04:19 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-12-18 22:04:19 +0800 |
commit | 354989177fb38c9d550044ec7ef11a6f4a36f9c9 (patch) | |
tree | 263a3026c4f7af95cf22c6d2603f191aaca33ca0 /script-beta/proto/define.lua | |
parent | deeea2b803f0267ccc0dd033362a8015be12f5eb (diff) | |
download | lua-language-server-354989177fb38c9d550044ec7ef11a6f4a36f9c9.zip |
#112 安全的求 utf8 长度
Diffstat (limited to 'script-beta/proto/define.lua')
-rw-r--r-- | script-beta/proto/define.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/script-beta/proto/define.lua b/script-beta/proto/define.lua index 3c955c95..c5002cbf 100644 --- a/script-beta/proto/define.lua +++ b/script-beta/proto/define.lua @@ -1,4 +1,5 @@ local guide = require 'parser.guide' +local util = require 'utility' local m = {} @@ -30,7 +31,7 @@ function m.position(lines, text, offset) if start < 1 then start = 1 end - local ucol = utf8.len(text, start, start + col - 1, true) + local ucol = util.utf8Len(text, start, start + col - 1, true) if row < 1 then row = 1 end |