Skip to content

Commit 65e9605

Browse files
fix: handle empty table in additionalTextEdits (#99)
1 parent 340370d commit 65e9605

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/blink/cmp/accept/text-edits.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function text_edits.apply_additional_text_edits(item)
2828
-- LSPs can either include these in the initial response or require a resolve
2929
-- These are used for things like auto-imports
3030
-- todo: if the main text edit was before this text edit, do we need to compensate?
31-
if item.additionalTextEdits ~= nil then
31+
if item.additionalTextEdits ~= nil and next(item.additionalTextEdits) ~= nil then
3232
text_edits.apply_text_edits(item.client_id, item.additionalTextEdits)
3333
else
3434
require('blink.cmp.sources.lib').resolve(item, function(resolved_item)

0 commit comments

Comments
 (0)