Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignores width? #81

Open
9mm opened this issue Jul 6, 2024 · 3 comments
Open

Ignores width? #81

9mm opened this issue Jul 6, 2024 · 3 comments

Comments

@9mm
Copy link

9mm commented Jul 6, 2024

Hey, whats up with the width? anything i put for maxsize, whether its 1, 100, or the function all look like this:

image

if i uncomment your plugin and use plain old cmp it looks like this:

image
      formatting = {
        expandable_indicator = true,
        fields = {
          "abbr",
          "kind",
          -- "menu",
        },
        format = lspkind.cmp_format({
          mode = "symbol_text",
          maxwidth = 10,
          ellipsis_char = "...",
          show_labelDetails = false,
          before = function (entry, item)
            return item
          end,
        })
  }
@9mm
Copy link
Author

9mm commented Jul 6, 2024

Very weird... the only way i got it to work was to set a blank string... i have no idea why

      formatting = {
        expandable_indicator = true,
        fields = {
          "abbr",
          "kind",
          "menu",
        },
        format = lspkind.cmp_format({
          mode = "symbol_text",
          maxwidth = 65,
          -- ellipsis_char = "...",
          show_labelDetails = false,
          before = function (entry, item)
            item.menu = ""
            return item
          end,
        })

@tzachar
Copy link

tzachar commented Aug 13, 2024

I think #83 fixes this.

@eeeXun
Copy link
Contributor

eeeXun commented Aug 19, 2024

What is your version of neovim and nvim-cmp?
I'm on the neovim 0.10.1 and latest nvim-cmp. This is the default nvim-cmp looks like.

image

The blank spaces in your picture should be the message provided by nvim_lsp.
The workaround for this could be to provide menus for each source.

        format = lspkind.cmp_format({
            menu = {
                path = "[PATH]",
                buffer = "[BUF]",
                nvim_lsp = "[LSP]",
                nvim_lua = "[LUA]",
                luasnip = "[SNIP]",
            },
        }),

Or just disable the menu of nvim_lsp.

        format = lspkind.cmp_format({
            menu = { nvim_lsp = nil },
        }),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants