From 7b85700704a5a366e5fc8a918a706ade018620ad Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 19 Apr 2026 00:51:18 +0200 Subject: fix: Fix LuaSnip moves --- lua/ache/plugins/nvim-cmp.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lua/ache/plugins/nvim-cmp.lua') diff --git a/lua/ache/plugins/nvim-cmp.lua b/lua/ache/plugins/nvim-cmp.lua index 5a63ab1..fc9ef0c 100644 --- a/lua/ache/plugins/nvim-cmp.lua +++ b/lua/ache/plugins/nvim-cmp.lua @@ -102,6 +102,26 @@ return { [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), [""] = cmp.mapping.confirm({ select = true }), + -- To add and in completion AND as luasnip edition move + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.locally_jumpable(1) then + luasnip.jump(1) + else + fallback() + end + end, { "i", "s" }), + + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), }), -- Order is important ! -- cgit v1.3-2-g11bf