summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-19 17:30:10 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-19 17:30:10 +0800
commita29304a6740f6d8953846830f68728ab9c60719b (patch)
treea212538b5e8eb3e7a83a0ea025e8ccbe5c581135
parent6e74a3935534f4dba252d78463cfcb11620cecbc (diff)
downloadlua-language-server-a29304a6740f6d8953846830f68728ab9c60719b.zip
check nil
-rw-r--r--script/provider/provider.lua2
1 files changed, 1 insertions, 1 deletions
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'