Skip to content

Commit

Permalink
fix: get global mapping for fallback in cmdline mode
Browse files Browse the repository at this point in the history
Closes #674
  • Loading branch information
Saghen committed Dec 20, 2024
1 parent 1d50e97 commit 92da013
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/blink/cmp/keymap/fallback.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ end
--- @param key string
--- @return fun(): string?
function fallback.wrap(mode, key)
local buffer_mapping = mode ~= 'c' and fallback.get_non_blink_buffer_mapping_for_key(mode, key) or nil
-- In default mode, there can't be multiple mappings on a single key for buffer local mappings
-- In cmdline mode, there can't be multiple mappings on a single key for global mappings
local buffer_mapping = mode ~= 'c' and fallback.get_non_blink_buffer_mapping_for_key(mode, key)
or fallback.get_non_blink_global_mapping_for_key(mode, key)
return function()
local mapping = buffer_mapping or fallback.get_non_blink_global_mapping_for_key(mode, key)
if mapping then return fallback.run_non_blink_keymap(mapping, key) end
Expand Down

0 comments on commit 92da013

Please sign in to comment.