From d8470a75175d951d8d6957f427b40c0f14e96013 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Thu, 2 Jul 2026 13:04:19 +0000 Subject: [PATCH] fix tab/s-tab with snippets --- nvim/lua/darcula/utils/globals.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/nvim/lua/darcula/utils/globals.lua b/nvim/lua/darcula/utils/globals.lua index 2ca57a0..5d8e517 100644 --- a/nvim/lua/darcula/utils/globals.lua +++ b/nvim/lua/darcula/utils/globals.lua @@ -77,7 +77,11 @@ NV_Darcula_Coc_Shift_Tab_Complete = function() return vim.fn["coc#pum#prev"](1) end - return "" + if vim.fn["coc#jumpable"](-1) == 1 then + return vim.fn["coc#rpc#request"]("doKeymap", {"snippets-previous"}) + end + + return "" end NV_Darcula_Coc_Tab_Complete = function() @@ -85,15 +89,17 @@ NV_Darcula_Coc_Tab_Complete = function() return vim.fn["coc#pum#next"](1) end + if vim.fn["coc#expandableOrJumpable"]() == 1 then + return vim.fn["coc#rpc#request"]("doKeymap", {"snippets-expand-jump"}) + end + local check_backspace = function() local col = vim.api.nvim_win_get_cursor(0)[2] - return (col == 0 or - vim.api.nvim_get_current_line():sub(col, col):match("%s")) and - true + return col == 0 or vim.api.nvim_get_current_line():sub(col, col):match("%s") end if check_backspace() then - return "" + return "" end return vim.fn["coc#refresh"]()