Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit f7256f2

Browse files
authored
Merge pull request #196 from glepnir/patch-1
fix user_data is nil
2 parents 4f578a2 + 9015cb7 commit f7256f2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lua/completion.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ end
6868
-- apply additionalTextEdits in LSP specs
6969
local function applyAddtionalTextEdits(completed_item)
7070
local lnum = api.nvim_win_get_cursor(0)[1]
71-
if completed_item.user_data == nil then return end
7271
if completed_item.user_data.lsp ~= nil then
7372
local item = completed_item.user_data.lsp.completion_item
7473
-- vim-vsnip have better additional text edits...
@@ -96,6 +95,7 @@ end
9695
-- handle completeDone stuff here
9796
local function hasConfirmedCompletion()
9897
local completed_item = api.nvim_get_vvar('completed_item')
98+
if completed_item.user_data == nil then return end
9999
if completed_item.user_data.lsp ~= nil then
100100
applyAddtionalTextEdits(completed_item)
101101
if vim.g.completion_enable_snippet == "snippets.nvim" then

0 commit comments

Comments
 (0)