vim-sneak icon indicating copy to clipboard operation
vim-sneak copied to clipboard

cchars displayed with label highlighting

Open BertrandSim opened this issue 3 years ago • 1 comments

Hello!

I notice that when sneak-label-mode is enabled, concealed cchars are shown with label highlighting.

Here is an example with .tex

image

" vimrc

call plug#begin('~/.vim/plugged')
  Plug 'lervag/vimtex'
  Plug 'justinmk/vim-sneak'
call plug#end()

let g:sneak#label = 1
% tex

$\alpha$ $\beta$
word word word

On the last line, pressing swo highlights α and β, even with set conceallevel=0.


I noticed that there are similar issues. However, those are specific to the Indent Line plugin. In general, this seems to occur with any buffer that uses cchars. I also noticed that #244 attempted to fix this issue, but the bug still persists.

I had a glance at the code for #244, and my hunch is that getmatches() only picks up groups defined by matchadd() and :match, and does not pick up groups defined by

syntax match {name} {regex} contained conceal cchar={char}

BertrandSim avatar Apr 06 '21 05:04 BertrandSim

There's no good way to fix this without causing other problems, AFAIK. #252 is a particular case of a general Vim limitation.

justinmk avatar Jul 03 '21 15:07 justinmk

https://github.com/justinmk/vim-sneak/pull/303 fixes this for Nvim.

justinmk avatar Aug 05 '23 14:08 justinmk