hrsh7th/nvim-cmp

cmp.config.window.bordered() changes active item highlight bg.

Open

#1029 opened on Jun 10, 2022

View on GitHub
 (5 comments) (1 reaction) (0 assignees)Lua (9,420 stars) (437 forks)batch import
bughelp wanted

Description

FAQ

  • I have checked the FAQ and it didn't resolve my problem.

Announcement

Minimal reproducible full config


if has('vim_starting')
  set encoding=utf-8
endif
scriptencoding utf-8

if &compatible
  set nocompatible
endif

let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/plug.vim')
  execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end

execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/vim-vsnip'
Plug 'neovim/nvim-lspconfig'
Plug 'olimorris/onedarkpro.nvim'
call plug#end()
PlugInstall | quit

colorscheme onedarkpro

" Setup global configuration. More on configuration below.
lua << EOF
local cmp = require "cmp"
cmp.setup {
  snippet = {
    expand = function(args)
      vim.fn["vsnip#anonymous"](args.body)
    end,
  },
  window = {
	completion = cmp.config.window.bordered(),
	documentation = cmp.config.window.bordered()
  }
  mapping = {
    ['<CR>'] = cmp.mapping.confirm({ select = true })
  },

  sources = {
    { name = "nvim_lsp" },
    { name = "buffer" },
  },
}
EOF

lua << EOF
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())

require'lspconfig'.cssls.setup {
  capabilities = capabilities,
}
EOF

Description

When I use cmp.config.window.bordered() it changes active item highlight bg for the completion menu.

Steps to reproduce

  1. Use minimal config above.
  2. Open any filetype
  3. Make sure language server is installed for that filetype
  4. Start typing anything.
  5. Select first item.
  6. See that it way too bright
  7. remove window section from cmp config.
  8. Repeat steps 2 - 5
  9. See color difference

Expected behavior

Expected color is around #2d323b (not exact)

Actual behavior

Actual color is around #52565e (not exact) (too bright)

Additional context

My complete config is at https://github.com/Lalit64/HydroVim

Contributor guide