From de11f4a1d0f6dc17c115c729f878820985236602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 5 Aug 2019 20:32:14 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=9B=A0=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E5=AD=97=E9=9D=A2=E9=87=8F=E4=B8=BA=E4=B8=8D=E5=8F=AF=E8=A7=81?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E5=AF=BC=E8=87=B4hover=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/core/hover/hover.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'server/src') diff --git a/server/src/core/hover/hover.lua b/server/src/core/hover/hover.lua index dbbafc30..ca1e03d4 100644 --- a/server/src/core/hover/hover.lua +++ b/server/src/core/hover/hover.lua @@ -32,8 +32,12 @@ local function formatString(str) str = str:sub(1000) end if str:find('[\r\n]') then + str = str:gsub('[\000-\008\011-\012\014-\031\127]', '') return longString(str) else + str = str:gsub('[\000-\008\011-\012\014-\031\127]', function (char) + return ('\\%03d'):format(char:byte()) + end) local single = str:find("'", 1, true) local double = str:find('"', 1, true) if single and double then -- cgit v1.2.3