From a29304a6740f6d8953846830f68728ab9c60719b 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, 19 Jul 2021 17:30:10 +0800 Subject: check nil --- script/provider/provider.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 8a500443..ac167867 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -830,7 +830,7 @@ proto.on('textDocument/onTypeFormatting', function (params) local core = require 'core.type-formatting' local offset = files.offset(uri, params.position) local edits = core(uri, offset - 1, ch) - if #edits == 0 then + if not edits or #edits == 0 then return nil end local tab = '\t' -- cgit v1.2.3