neoclide / coc-lists

Common lists for coc.nvim
264 stars 24 forks source link

Current line highlighting for CocLists #78

Closed arbitrary-dev closed 4 years ago

arbitrary-dev commented 4 years ago

Related to issue #70.

Currently selected items in CocLists use CursorLine highlighting group, but it causes problems (current line isn't highlighted in CocLists) for Vim users which use cursorline only for line numbers:

set cursorline
hi CursorLineNr ctermbg=red
hi CursorLine ctermbg=none

Proposal is to have a separate highlighting group for CocLists selection or set number for CocLists buffer.

chemzqm commented 4 years ago

We have to use cursorline, you can use command like:

  autocmd FileType list set winhighlight=CursorLine:CocUnderline

which works on neovim only

arbitrary-dev commented 4 years ago

Added following to my .vimrc as a workaround:

set cursorline
hi CursorLine cterm=none
map <silent> <leader>cl :call ToggleCursorLine()<CR>
function ToggleCursorLine()
  if match(execute('hi CursorLine'), 'ctermbg') >= 0
    hi CursorLine ctermbg=none
  else
    hi CursorLine ctermbg=52
  endif
endfunction