hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
7.45k stars 370 forks source link

Cmp Menu is occupying unnecessary space #1884

Closed GustavoPrietoP closed 2 months ago

GustavoPrietoP commented 2 months ago

Slightly simplified version of question from #1 showing similar issue with just an abbr.

Default with formatting = {}:

Screenshot 2022-04-12 at 21 39 54

So far so good. Seems like default is https://github.com/hrsh7th/nvim-cmp/blob/3192a0c57837c1ec5bf298e4f3ec984c7d2d60c0/lua/cmp/config/default.lua#L98 So let's try without kind and menu:

  formatting = {
    fields = { cmp.ItemField.Abbr  },
  },

and we get:

Screenshot 2022-04-12 at 22 07 52

Not so good, window expands further than it really needs to. Why is abbr alone displayed like that?

Also, should field be table of strings or enums from cmp.ItemField?

Thanks!

Originally posted by @gegoune in https://github.com/hrsh7th/nvim-cmp/discussions/891

GustavoPrietoP commented 2 months ago

I've added formatting = {fields = {'abbr', 'kind'}, } and for some reason the menu is taking up unnecessary space. Is there a fix? image