From 4bc9389bb5347bb6af119daa6dd16ee646436453 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 21:32:53 +0200 Subject: [PATCH] refactor(snippets): refactored snippet code --- lua/lazyvim/plugins/coding.lua | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 0cbdd7b6..19c7785b 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -115,38 +115,16 @@ return { { "", function() - if vim.snippet.active({ direction = 1 }) then - vim.schedule(function() - vim.snippet.jump(1) - end) - return - end - return "" + return vim.snippet.active({ direction = 1 }) and "lua vim.snippet.jump(1)" or "" end, expr = true, silent = true, - mode = "i", - }, - { - "", - function() - vim.schedule(function() - vim.snippet.jump(1) - end) - end, - silent = true, - mode = "s", + mode = { "i", "s" }, }, { "", function() - if vim.snippet.active({ direction = -1 }) then - vim.schedule(function() - vim.snippet.jump(-1) - end) - return - end - return "" + return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" end, expr = true, silent = true,