From 2b661485f8ddfb65470df5701c92aea9c4c63038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20Jos=C3=A9=20Solano?= Date: Fri, 30 Aug 2024 09:01:55 -0700 Subject: [PATCH] fix(snippet): don't set navigation mappings in nightly --- lua/lazyvim/plugins/coding.lua | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 8b982033..097d902d 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -102,26 +102,17 @@ return { table.insert(opts.sources, { name = "snippets" }) end end, - keys = { - { - "", - function() + init = function() + -- Neovim enabled snippet navigation mappings by default in v0.11 + if vim.fn.has("nvim-0.11") == 0 then + vim.keymap.set({ "i", "s" }, "", function() return vim.snippet.active({ direction = 1 }) and "lua vim.snippet.jump(1)" or "" - end, - expr = true, - silent = true, - mode = { "i", "s" }, - }, - { - "", - function() + end, { expr = true, silent = true }) + vim.keymap.set({ "i", "s" }, "", function() return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" - end, - expr = true, - silent = true, - mode = { "i", "s" }, - }, - }, + end, { expr = true, silent = true }) + end + end, }, -- auto pairs