fix(snippet): don't set navigation mappings in nightly

This commit is contained in:
Maria José Solano 2024-08-30 09:01:55 -07:00
parent 12818a6cb4
commit 2b661485f8

View file

@ -102,26 +102,17 @@ return {
table.insert(opts.sources, { name = "snippets" }) table.insert(opts.sources, { name = "snippets" })
end end
end, end,
keys = { init = function()
{ -- Neovim enabled snippet navigation mappings by default in v0.11
"<Tab>", if vim.fn.has("nvim-0.11") == 0 then
function() vim.keymap.set({ "i", "s" }, "<Tab>", function()
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>" return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
end, end, { expr = true, silent = true })
expr = true, vim.keymap.set({ "i", "s" }, "<S-Tab>", function()
silent = true,
mode = { "i", "s" },
},
{
"<S-Tab>",
function()
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<S-Tab>" return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<S-Tab>"
end, end, { expr = true, silent = true })
expr = true, end
silent = true, end,
mode = { "i", "s" },
},
},
}, },
-- auto pairs -- auto pairs