Closed Racle closed 3 years ago
Thank you for your report!
This problem happened simply because tagalong.vim do yank a text. (I also tried to check coc.nvim but it was too complex to me...) As you guess, the vim-highlightedyank hooks the highlighting operation whenever a text yanked by using TextYankPost
event. But our difficulty is that there is no way to judge who yanked the text; man or machine?
I have two solutions here. One is to use the key mapping <Plug>(highlightedyank)
. It automatically stops using the TextYankPost
event and highlights text only when you press y
. This key mapping actually is not quite clean internally, just kept for old vim which doesn't have TextYankPost
event. However, it will circumvent this problem at least.
map y <Plug>(highlightedyank)
Another solution is to send a small PR for tagalong.vim to use :noautocmd
, I think if this line is modified to exec 'silent noautocmd normal! '.a:motion.'"zy'
, then the problem would be solved. This function just aimed at obtaining a text on the buffer, I think it doesn't intend to trigger any auto command events.
map y <Plug>(highlightedyank)
This seems to be working perfectly so far. Thank you for very fast response!
And for second solution, I tested that and it seems to be working also.
I created PR and explained situation. This could be even better solution as it might impact other users also.
When this plugin and AndrewRadev/tagalong.vim are enabled, vim-highlighedyank highlights tag when going to insert mode.
Ex. I got
and move cursor over N and press
i
, highlighedyank highlights<div className='classname'>
part. And same thing when going back to normal mode withctrl + c
Using
NVIM v0.4.4
(same issue with version 0.5).Minimal reproducible test config (with vim-plug installed):
Not sure if this is issue with vim-highlightedyank, tagalong or something else. This also happens with
CocAction('doHover')
.First thing I can think is that highlightedyank probably uses some event and those also trigger that event they select words under cursor (?).