From 8a426b9e62c1e31b5bb1057f259b30e11011c03d Mon Sep 17 00:00:00 2001 From: max397574 Date: Fri, 8 Oct 2021 15:26:20 +0200 Subject: [PATCH] fix cmp use new function --- lua/plugins/configs/cmp.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua index 045a9d9..e928e54 100644 --- a/lua/plugins/configs/cmp.lua +++ b/lua/plugins/configs/cmp.lua @@ -44,7 +44,7 @@ cmp.setup { }, [""] = function(fallback) if cmp.visible() then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), "n") + cmp.select_next_item() elseif require("luasnip").expand_or_jumpable() then vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") else @@ -52,9 +52,9 @@ cmp.setup { end end, [""] = function(fallback) - if cmp.visible() then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), "n") - elseif require("luasnip").jumpable(-1) then + if cmp.visible() then + cmp.select_next_item() + elseif require("luasnip").jumpable(-1) then vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") else fallback()