From 40b1760262b817dd59188043f31ba87c8f8033c6 Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Sat, 2 Nov 2024 18:00:43 -0400 Subject: [PATCH] refactor: cleanup keymap preset func --- lua/blink/cmp/keymap.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lua/blink/cmp/keymap.lua b/lua/blink/cmp/keymap.lua index 29bd97f8..d644fcf1 100644 --- a/lua/blink/cmp/keymap.lua +++ b/lua/blink/cmp/keymap.lua @@ -123,20 +123,17 @@ end --- Gets the preset keymap for the given preset name --- @param preset_name string ---- @return table +--- @return table 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