From 23f0c601cbc175b1acdca271423cbcb372abfc38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sun, 10 Nov 2019 23:36:54 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3range=E5=9D=90=E6=A0=87=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/src/proto/define.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server-beta/src/proto') diff --git a/server-beta/src/proto/define.lua b/server-beta/src/proto/define.lua index 1bf45531..62c85989 100644 --- a/server-beta/src/proto/define.lua +++ b/server-beta/src/proto/define.lua @@ -43,10 +43,12 @@ end ---@param offset1 integer ---@param offset2 integer function m.range(lines, text, offset1, offset2) - return { - start = m.position(lines, text, offset1-1), + local range = { + start = m.position(lines, text, offset1), ['end'] = m.position(lines, text, offset2), } + range.start.character = range.start.character - 1 + return range end ---@alias location table -- cgit v1.2.3