From 258fd3911c143c03c0dffcf9f7e3e6c3345cdd31 Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Wed, 4 Dec 2024 16:00:25 -0500 Subject: [PATCH] docs: add note about not being able to use ctx.cursor in luasnip source --- lua/blink/cmp/sources/luasnip.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/blink/cmp/sources/luasnip.lua b/lua/blink/cmp/sources/luasnip.lua index 2f50f7cc..587ef2a7 100644 --- a/lua/blink/cmp/sources/luasnip.lua +++ b/lua/blink/cmp/sources/luasnip.lua @@ -118,6 +118,7 @@ function source:execute(ctx, item) if snip.regTrig then snip = snip:get_pattern_expand_helper() end -- get (0, 0) indexed cursor position + -- the completion has been accepted by this point, so ctx.cursor is out of date local cursor = vim.api.nvim_win_get_cursor(0) cursor[1] = cursor[1] - 1