From a99a789f74479ec4a21984866c877aed2bff8af7 Mon Sep 17 00:00:00 2001 From: siduck Date: Sat, 18 Jun 2022 14:25:23 +0530 Subject: [PATCH] fix #1223 --- lua/core/init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/core/init.lua b/lua/core/init.lua index 12f0782..edb0a71 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -27,3 +27,14 @@ autocmd("BufEnter", { pattern = "*", command = "set fo-=c fo-=r fo-=o", }) + +autocmd("InsertLeave", { + callback = function() + if + require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()] + and not require("luasnip").session.jump_active + then + require("luasnip").unlink_current() + end + end, +})