diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-05 20:17:49 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-05 20:17:49 +0800 |
commit | bab7c96347957948d59a85ebb3e3288c8273e3bb (patch) | |
tree | 57fdd92c47434966648cc943f2db63606ec128e1 /script/proto | |
parent | 0353900ee3a41d3e92d3645bddb4d46ea60c7c3f (diff) | |
download | lua-language-server-bab7c96347957948d59a85ebb3e3288c8273e3bb.zip |
accept commit characters
Diffstat (limited to 'script/proto')
-rw-r--r-- | script/proto/define.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/script/proto/define.lua b/script/proto/define.lua index 1425395a..082e382a 100644 --- a/script/proto/define.lua +++ b/script/proto/define.lua @@ -49,7 +49,7 @@ function m.position(lines, text, offset) if start < 1 then start = 1 end - if col <= finish then + if col <= finish - start + 1 then local ucol = util.utf8Len(text, start, start + col - 1) if row < 1 then row = 1 @@ -58,6 +58,11 @@ function m.position(lines, text, offset) line = row - 1, character = ucol, } + elseif col == 1 then + return { + line = row - 1, + character = 0, + } else return { line = row, |