onsails / lspkind.nvim

vscode-like pictograms for neovim lsp completion items
MIT License
1.51k stars 39 forks source link

Formatting disappears upon navigating into the menu #48

Closed hahuang65 closed 2 years ago

hahuang65 commented 2 years ago

While typing, the formatting shows up:

Screen Shot 2022-04-18 at 2 28 46 PM

But as soon as I press <C-n> to choose something, the formatting disappears (along with some options):

Screen Shot 2022-04-18 at 2 30 35 PM

This is my entire nvim-cmp configuration:

local cmp = require'cmp'

cmp.setup({
  snippet = {
    -- REQUIRED - you must specify a snippet engine
    expand = function(args)
      require('luasnip').lsp_expand(args.body)
    end,
  },
  mapping = {
    ['<C-d>']     = cmp.mapping.scroll_docs(-4),
    ['<C-f>']     = cmp.mapping.scroll_docs(4),
    ['<C-e>']     = cmp.mapping({
      i           = cmp.mapping.abort(),
      c           = cmp.mapping.close()
    }),
    ["<c-y>"]     = cmp.mapping.confirm({
        behavior  = cmp.ConfirmBehavior.Replace,
        select    = true,
    })
  },
  sources = {
    { name = 'nvim_lsp' },
    { name = 'luasnip' },
    { name = 'orgmode' },
    { name = 'nvim_lua' },
    { name = 'path' },
    { name = 'buffer', keyword_length = 5 },
  },
  experimental = {
    native_menu = false,
    ghost_text = true,
  },
  formatting = {
    format = require'lspkind'.cmp_format({
      with_text = true,
      menu = ({
        buffer = "[Buffer]",
        nvim_lsp = "[LSP]",
        nvim_lua = "[Lua]",
        path = "[Path]"
      })
    }),
  },
})
gegoune commented 2 years ago

Check out latest breaking changes on cmp (default mappings were removed).

hahuang65 commented 2 years ago

Ah, that was it, thank you!