summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'