Skip to content

Commit

Permalink
Fix native menu bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hrsh7th committed Nov 3, 2021
1 parent dc6b458 commit a881adb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/cmp/view/native_entries_view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ end

native_entries_view.close = function(self)
if api.is_suitable_mode() then
vim.api.nvim_select_popupmenu_item(-1, false, true, {})
vim.api.nvim_select_popupmenu_item(-1, false, false, {})
end
self.offset = -1
self.entries = {}
Expand Down

3 comments on commit a881adb

@dmitmel
Copy link
Collaborator

@dmitmel dmitmel commented on a881adb Nov 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit breaks mappings which use cmp.mapping.close. What bug does it fix? Here's a minimal vimrc:

set rtp+=~/.config/nvim/plugged/nvim-cmp
set rtp+=~/.config/nvim/plugged/cmp-buffer
set rtp+=~/.config/nvim/plugged/cmp-buffer/after
lua <<EOF
local cmp = require('cmp')
cmp.setup({
  sources = {
    { name = 'buffer' },
  },
  experimental = {
    native_menu = true,
  },
  mapping = {
    ['<C-Space>'] = cmp.mapping.complete(),
    ['<Esc>'] = cmp.mapping.close(),
  },
})
EOF

@hrsh7th
Copy link
Owner Author

@hrsh7th hrsh7th commented on a881adb Nov 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. It introduces the new bug.
I've fixed it in the latest main branch.

@dmitmel
Copy link
Collaborator

@dmitmel dmitmel commented on a881adb Nov 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Please sign in to comment.