From 1278a3b70363cda48a464074a3ead4df668a6899 Mon Sep 17 00:00:00 2001 From: socialsmoker223 Date: Fri, 4 Mar 2022 07:53:40 +0800 Subject: [PATCH] Imporve luasnip Tab jump behaviour --- 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 94944b7..02b77e9 100644 --- a/lua/plugins/configs/cmp.lua +++ b/lua/plugins/configs/cmp.lua @@ -37,7 +37,7 @@ local default = { behavior = cmp.ConfirmBehavior.Replace, select = true, }, - [""] = function(fallback) + [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif require("luasnip").expand_or_jumpable() then @@ -45,8 +45,8 @@ local default = { else fallback() end - end, - [""] = function(fallback) + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() elseif require("luasnip").jumpable(-1) then @@ -54,7 +54,7 @@ local default = { else fallback() end - end, + end, { "i", "s" }), }, sources = { { name = "nvim_lsp" },