From 7be970e278334482710e1f37936c8480b522a751 Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Mon, 16 Dec 2024 18:34:50 -0500 Subject: [PATCH] fix: check raw key for space in cmdline_events --- lua/blink/cmp/lib/cmdline_events.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/blink/cmp/lib/cmdline_events.lua b/lua/blink/cmp/lib/cmdline_events.lua index de4c276c..88280ab7 100644 --- a/lua/blink/cmp/lib/cmdline_events.lua +++ b/lua/blink/cmp/lib/cmdline_events.lua @@ -29,13 +29,13 @@ function cmdline_events:listen(opts) local did_backspace = false local is_change_queued = false - vim.on_key(function(_, escaped_key) + vim.on_key(function(raw_key, escaped_key) if vim.api.nvim_get_mode().mode ~= 'c' then return end -- ignore if it's a special key local key = vim.fn.keytrans(escaped_key) if key == '' and not is_change_queued then did_backspace = true end - if key:sub(1, 1) == '<' and key:sub(#key, #key) == '>' and key ~= '' then return end + if key:sub(1, 1) == '<' and key:sub(#key, #key) == '>' and raw_key ~= ' ' then return end if not is_change_queued then is_change_queued = true