itchyny / vim-cursorword

Underlines the word under the cursor
http://www.vim.org/scripts/script.php?script_id=5100
MIT License
611 stars 36 forks source link

When you move the cursor or modify the text, the highlight flashes. #30

Closed onlycalm closed 3 years ago

onlycalm commented 3 years ago

This is a good plug-in. When I use it, I find that the highlight flickers in the following two cases:

  1. When I move the cursor.
  2. When I edit the text.

Here is my configuration:

let g:cursorword = 1
let g:cursorword_highlight = 0
let g:cursorword_delay = 50
hi CursorWord0 ctermbg=darkgrey guibg=darkgrey term=none cterm=none gui=none
hi CursorWord1 ctermbg=darkgrey guibg=darkgrey term=none cterm=none gui=none

I try to g:cursorword_delay = 10, but the flicker is still visible.

https://user-images.githubusercontent.com/48640489/120916596-10641a80-c6dd-11eb-9712-6887a67f4a19.mp4

itchyny commented 3 years ago

This is an expected behavior. Try let g:cursorword_delay = 0.

onlycalm commented 3 years ago

Thank you, the above method is useful(let g:cursorword_delay = 0), but I observed another exception. The highlight of some words will be invalid after flashing once.

https://user-images.githubusercontent.com/48640489/121052397-e9950980-c7ec-11eb-915b-ecfcf58f311d.mp4

itchyny commented 3 years ago

I don't see what's wrong in your screenshot.

onlycalm commented 3 years ago

image

Sorry, I didn't express the question clearly. This is a test in vs. When the cursor is over the variable temp, it should remain highlighted.

onlycalm commented 3 years ago

Well, I mean. In the video, the highlight of the temp variable flashes only once, and then it goes out.

itchyny commented 3 years ago

Everything is working well for me and I can't reproduce your issue. Describe the detailed steps, minimal vimrc (less than 30 lines) to reproduce the problem, with OS, Vim versions.

onlycalm commented 3 years ago

Maybe there is a conflict with the highlight of other plug-ins. When I get home, I will try to turn off other plug-ins to find out where the conflict is. I'll come back here later. Thank you!

onlycalm commented 3 years ago

Hi. I checked the configuration There is a conflict with the configuration of coc.nvim. I commented the following code and it works normally.

" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')