From db635f201f5ac5f48e7e33cc268f23e7646fd946 Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Wed, 16 Oct 2024 16:51:52 -0400 Subject: [PATCH] fix: select always triggering when auto_show enabled --- lua/blink/cmp/init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/blink/cmp/init.lua b/lua/blink/cmp/init.lua index 6ca6d1ab..3cd4b995 100644 --- a/lua/blink/cmp/init.lua +++ b/lua/blink/cmp/init.lua @@ -157,6 +157,7 @@ cmp.select_and_accept = function() vim.schedule(function() -- select an item if none is selected if not cmp.windows.autocomplete.get_selected_item() then cmp.windows.autocomplete.select_next() end + local item = cmp.windows.autocomplete.get_selected_item() if item ~= nil then require('blink.cmp.accept')(item) end end) @@ -164,7 +165,8 @@ cmp.select_and_accept = function() end cmp.select_prev = function() - if not cmp.windows.autocomplete.win:is_open() and not cmp.windows.autocomplete.auto_show then + if not cmp.windows.autocomplete.win:is_open() then + if cmp.windows.autocomplete.auto_show then return end cmp.show() return true end @@ -173,7 +175,8 @@ cmp.select_prev = function() end cmp.select_next = function() - if not cmp.windows.autocomplete.win:is_open() and not cmp.windows.autocomplete.auto_show then + if not cmp.windows.autocomplete.win:is_open() then + if cmp.windows.autocomplete.auto_show then return end cmp.show() return true end