Skip to content

Commit

Permalink
fix: check raw key for space in cmdline_events
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Dec 16, 2024
1 parent 8f718cc commit 7be970e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/blink/cmp/lib/cmdline_events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 == '<BS>' and not is_change_queued then did_backspace = true end
if key:sub(1, 1) == '<' and key:sub(#key, #key) == '>' and key ~= '<Space>' 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
Expand Down

0 comments on commit 7be970e

Please sign in to comment.