We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
It seems I have a similar issue as in #44 but in the CMP integrated menu.
I'm using the CMP integration taken from README.
It's working for the most part but even with --white defined it shows no HL color in the CMP menu and in the "var" variable:
--white
Now I noticed that, if I use a different CMP integration like the lspkind I get a different result:
It seems this formatting function is not working for --white as it's returning the color glyph directly from lspkind:
lspkind
formatting = { format = function(entry, item) local color_item = require("nvim-highlight-colors").format(entry, { kind = item.kind }) item = require("lspkind").cmp_format({ -- any lspkind format settings here })(entry, item) if color_item.abbr_hl_group then item.kind_hl_group = color_item.abbr_hl_group item.kind = color_item.abbr end return item end },
Using the below minimal config I see the same issue:
Minimal:
-- DO NOT change the paths and don't remove the colorscheme local root = vim.fn.fnamemodify("./.repro", ":p") -- set stdpaths to use .repro for _, name in ipairs({ "config", "data", "state", "cache" }) do vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name end -- bootstrap lazy local lazypath = root .. "/plugins/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, }) end vim.opt.runtimepath:prepend(lazypath) -- install plugins local plugins = { "folke/tokyonight.nvim", "folke/noice.nvim", -- add any other plugins here "nvim-neo-tree/neo-tree.nvim", "nvim-lua/plenary.nvim", "rodhash/nvim-web-devicons", "MunifTanjim/nui.nvim", "rcarriga/nvim-notify", "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", "ray-x/lsp_signature.nvim", -- LSP "neovim/nvim-lspconfig", "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", -- Completion "hrsh7th/nvim-cmp", "hrsh7th/cmp-nvim-lsp", "hrsh7th/nvim-cmp", "hrsh7th/cmp-buffer", -- vsnip "hrsh7th/cmp-vsnip", "hrsh7th/vim-vsnip", -- others 'brenoprata10/nvim-highlight-colors', 'onsails/lspkind.nvim', } require("lazy").setup(plugins, { root = root .. "/plugins", }) vim.cmd.colorscheme("tokyonight") -- add anything else here local nvim_set_hl = vim.api.nvim_set_hl require("noice").setup({ lsp = { signature = { enabled = false, }, }} ) require("mason").setup() require("mason-lspconfig").setup { ensure_installed = { "cssls", "tailwindcss" }, } require'lsp_signature'.setup() -- no need to specify bufnr if you don't use toggle_key -- CMP -- Set up nvim-cmp. local cmp = require'cmp' cmp.setup({ formatting = { format = function(entry, item) local color_item = require("nvim-highlight-colors").format(entry, { kind = item.kind }) item = require("lspkind").cmp_format({ -- any lspkind format settings here })(entry, item) if color_item.abbr_hl_group then item.kind_hl_group = color_item.abbr_hl_group item.kind = color_item.abbr end return item end }, snippet = { -- REQUIRED - you must specify a snippet engine expand = function(args) vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. -- require('snippy').expand_snippet(args.body) -- For `snippy` users. -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. end, }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ ['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-Space>'] = cmp.mapping.complete(), ['<C-e>'] = cmp.mapping.abort(), ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. ['<C-h>'] = function() cmp.complete() end, }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'vsnip' }, { name = "buffer" }, -- { name = 'luasnip' }, -- For luasnip users. -- { name = 'ultisnips' }, -- For ultisnips users. -- { name = 'snippy' }, -- For snippy users. }) }) -- Set up lspconfig. local capabilities = require('cmp_nvim_lsp').default_capabilities() capabilities.textDocument.completion.completionItem.snippetSupport = true capabilities.offsetEncoding = { "utf-16" } -- require('lspconfig').terraformls.setup({ -- filetypes = { "terraform", "tf", "terraform-vars" }, -- capabilities = capabilities -- }) -- require('lspconfig')['cssls'].setup { capabilities = capabilities } require('nvim-highlight-colors').setup({ exclude_buftypes = { "nofile" }, exclude_filetypes = { "nofile" }, })
ps: I had to exclude "nofile" because another issue happened but I don't think we need to discuss that here.
Any idea why some colors (like --white) are having this issue?
Thanks.
The text was updated successfully, but these errors were encountered:
Oh that's interesting, it worked now.
It seems the bug happens when colors are set with 3 Hex chars:
/* Issues in CMP menu and vars lines */ --white: #fff; /* No issues */ --white: #ffffff;
Sorry, something went wrong.
I can confirm this issue. 3 letter colors are highlighted, however when used in variables, it's not highlighted.
No branches or pull requests
Hello,
It seems I have a similar issue as in #44 but in the CMP integrated menu.
I'm using the CMP integration taken from README.
It's working for the most part but even with
![image](https://private-user-images.githubusercontent.com/29671981/384600345-27ee95bf-0a9c-4ddd-ba1d-cdf45937dc49.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzk2OTcsIm5iZiI6MTczOTEzOTM5NywicGF0aCI6Ii8yOTY3MTk4MS8zODQ2MDAzNDUtMjdlZTk1YmYtMGE5Yy00ZGRkLWJhMWQtY2RmNDU5MzdkYzQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDIyMTYzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYyNmMyZDAxNjBkYjU1N2Q4NGM2YzQwY2E5YzA2ZmUzNDUyYzMyZGYwYTVjYmE3ZGYwZTZhOTM4YjY2ZDY3ODEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.e6zTBdvRFFv-WxwJIUeI3_ZCrkRugouKj3vm-_YoO04)
--white
defined it shows no HL color in the CMP menu and in the "var" variable:Now I noticed that, if I use a different CMP integration like the lspkind I get a different result:
![image](https://private-user-images.githubusercontent.com/29671981/384600707-abd189c0-f437-4d13-a467-4731e8c30b0f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzk2OTcsIm5iZiI6MTczOTEzOTM5NywicGF0aCI6Ii8yOTY3MTk4MS8zODQ2MDA3MDctYWJkMTg5YzAtZjQzNy00ZDEzLWE0NjctNDczMWU4YzMwYjBmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDIyMTYzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkMzA1NDlmYjY4Mjc5MjM3ZDQwMzA1NzYxN2UwYzA1Y2NiNGFiZDI0ZTQ4MDMyMWJiOWEwYTJhM2Y4YjhhMTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.PFZPPuCgXcExpmnWKHspN-kseY3cPFOMRY4wzQVmj0s)
It seems this formatting function is not working for
--white
as it's returning the color glyph directly fromlspkind
:Using the below minimal config I see the same issue:
Minimal:
ps: I had to exclude "nofile" because another issue happened but I don't think we need to discuss that here.
Any idea why some colors (like
--white
) are having this issue?Thanks.
The text was updated successfully, but these errors were encountered: