Skip to content

Commit

Permalink
refactor: cleanup keymap preset func
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Nov 2, 2024
1 parent f9c58ab commit 40b1760
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lua/blink/cmp/keymap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,17 @@ end

--- Gets the preset keymap for the given preset name
--- @param preset_name string
--- @return table
--- @return table<string, blink.cmp.KeymapCommand[]>
function keymap.get_preset_keymap(preset_name)
local mappings
if preset_name == 'default' then
mappings = default_keymap
return default_keymap
elseif preset_name == 'super-tab' then
mappings = super_tab_keymap
return super_tab_keymap
elseif preset_name == 'enter' then
mappings = enter_keymap
else
error('Invalid blink.cmp keymap preset: ' .. preset_name)
return enter_keymap
end

return mappings
error('Invalid blink.cmp keymap preset: ' .. preset_name)
end

--- Applies the keymaps to the current buffer
Expand Down

0 comments on commit 40b1760

Please sign in to comment.