🐛 fix(nvim): disable luasnip autocmd when inside vscode

This commit is contained in:
Sergio Laín 2024-02-23 09:18:24 +01:00
parent b118a9ec27
commit f3e9868129
No known key found for this signature in database
GPG key ID: 14C9B8080681777B

View file

@ -96,6 +96,7 @@ ac({ "BufNewFile", "BufRead" }, {
ac("ModeChanged", { ac("ModeChanged", {
pattern = "*", pattern = "*",
callback = function() callback = function()
if not vim.g.vscode then
if if
((vim.v.event.old_mode == "s" and vim.v.event.new_mode == "n") or vim.v.event.old_mode == "i") ((vim.v.event.old_mode == "s" and vim.v.event.new_mode == "n") or vim.v.event.old_mode == "i")
and require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()] and require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
@ -103,6 +104,7 @@ ac("ModeChanged", {
then then
require("luasnip").unlink_current() require("luasnip").unlink_current()
end end
end
end, end,
}) })