Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit 62fbd44

Browse files
committed
fix: weird confirm key behavior(#116)
1 parent f5ee2a3 commit 62fbd44

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lua/completion.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ M.on_attach = function(opt)
203203
api.nvim_command("augroup end")
204204
if string.len(vim.g.completion_confirm_key) ~= 0 then
205205
api.nvim_buf_set_keymap(0, 'i', vim.g.completion_confirm_key,
206-
'<cmd>call completion#wrap_completion()<CR>', {silent=true, noremap=true})
206+
'pumvisible() ? complete_info()["selected"] != "-1" ? "\\<Plug>(completion_confirm_completion)" : "\\<c-e>\\<CR>" : "\\<CR>"',
207+
{silent=false, noremap=false, expr=true})
207208
end
208209
api.nvim_buf_set_var(0, 'completion_enable', 1)
209210
if opt == nil then return end

0 commit comments

Comments
 (0)