From 4403c8c1403867fa44630f3c9272a92b90b7fcb3 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sun, 22 Dec 2024 17:17:54 -0600 Subject: [PATCH] fix(nvim): make `blink.cmp` correctly complete command line --- .../nvim/lua/plugins/configs/blink.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/users/price/dots/.config/nvim/lua/plugins/configs/blink.lua b/users/price/dots/.config/nvim/lua/plugins/configs/blink.lua index 290d0ce4..fa01541d 100644 --- a/users/price/dots/.config/nvim/lua/plugins/configs/blink.lua +++ b/users/price/dots/.config/nvim/lua/plugins/configs/blink.lua @@ -50,7 +50,24 @@ return { preset = "default", [""] = { "show", "show_documentation", "hide_documentation" }, [""] = { "hide", "fallback" }, - [""] = { "accept", "fallback" }, + [""] = { + function(cmp) + if vim.api.nvim_get_mode().mode:lower() == "c" then + return cmp.accept({ + callback = function() + vim.api.nvim_feedkeys( + vim.api.nvim_replace_termcodes("", true, true, true), + "n", + true + ) + end, + }) + else + return cmp.accept() + end + end, + "fallback", + }, [""] = { function(cmp) if cmp.snippet_active() then