From 241c5873186a45ec0c226fff180d2dddd93c76c2 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Mon, 25 Sep 2023 15:30:34 +0700 Subject: [PATCH] Revert "chore(nvim): workaround for nvim-cmp" This reverts commit 4b819bcb012a99ed6a8408593f59d5ec5e973d50. --- data/nvim/init.lua | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/data/nvim/init.lua b/data/nvim/init.lua index 389dc7e..ca04358 100644 --- a/data/nvim/init.lua +++ b/data/nvim/init.lua @@ -316,9 +316,6 @@ require("lazy").setup({ }, config = function() local cmp = require("cmp") - local feedkeys = require("cmp.utils.feedkeys") - local keymap = require("cmp.utils.keymap") - cmp.setup({ performance = { max_view_entries = 8, @@ -331,29 +328,7 @@ require("lazy").setup({ mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), - - -- https://github.com/hrsh7th/nvim-cmp/issues/1326 - -- https://github.com/vim/vim/issues/12230 - -- https://github.com/neovim/neovim/issues/22892 - [""] = function(fallback) - if vim.fn.pumvisible() == 1 then - if vim.fn.complete_info({ "selected" }).selected == -1 then - -- Nothing selected, insert newline - -- feedkeys.call(keymap.t(""), "in") - return - end - - -- Something selected, confirm selection by stopping Ctrl-X mode - -- :h i_CTRL-X_CTRL-Z* - feedkeys.call(keymap.t(""), "in") - return - end - - -- `nvim-cmp` default confirm action - -- Accept currently selected item - -- Set `select` to `false` to only confirm explicitly selected items - cmp.mapping.confirm({ select = false })(fallback) - end, + [""] = cmp.mapping.confirm({ select = true }), }), completion = { autocomplete = false,