Closed poetaman closed 3 years ago
Perhaps an alternative (though slower than text properties) would be to apply a filetype to popup menu's buffer opened by coc, something like this:
let cocpmenuwinid = call popup_menu(a:items, {
\ 'title': a:title,
\ 'filter': function('s:QuickpickFilter'),
\ 'callback': function('s:QuickpickHandler'),
\ })
call setbufvar(winbufnr(cocpmenuwinid), '&filetype', 'cocpmenu')``
redraw
Then users can use their usual filetype highlight groups from devicons to apply coloring to devicons using other plugins. In any case, setting a filetype for popup window will be beneficial I think.
Note: I am shooting in dark white the code snippet from: https://github.com/neoclide/coc.nvim/blob/5e4dcf72bf47aabb8b579b16812dacdac5b2e77c/autoload/coc/util.vim#L388 Don't know if that's the exact piece of code used to create coc popup menu.
It's vim's pum, not popup of vim8, which doesn't provide such kind of support. Report your feature request to vim.
@chemzqm I reported this to Vim team. Vim's author Bram seems to suggest it is possible to replace pum with popup window: https://github.com/vim/vim/issues/8043#issuecomment-811259848
We have to support neovim and exist configuration, that would be too complicated
@chemzqm Ok, can you comment on the vim ticket, and explain your point to Bram?
Currently all the fields in the popup menu have same color. It would be nice to have each field have its own color, and devicons have their individual colors too.
Given the width of each field is decided by the widest element in that field, a text property solution would be fastest (if text properties are possible in popup).