From 475731741bbd8266767d48ad46b63f715577ac8e Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Sat, 21 Dec 2024 14:03:45 -0500 Subject: [PATCH] fix: wrong key upstreamed by cmdline_events Closes #700 --- lua/blink/cmp/lib/cmdline_events.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/blink/cmp/lib/cmdline_events.lua b/lua/blink/cmp/lib/cmdline_events.lua index 33b994fd..11714e13 100644 --- a/lua/blink/cmp/lib/cmdline_events.lua +++ b/lua/blink/cmp/lib/cmdline_events.lua @@ -35,6 +35,7 @@ function cmdline_events:listen(opts) if vim.api.nvim_get_mode().mode ~= 'c' then return end -- ignore if it's a special key + -- FIXME: odd behavior when escaped_key has multiple keycodes, i.e. by pressing and then "t" 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 raw_key ~= ' ' then return end @@ -43,7 +44,7 @@ function cmdline_events:listen(opts) is_change_queued = true did_backspace = false vim.schedule(function() - on_changed(escaped_key) + on_changed(raw_key) is_change_queued = false end) end