machakann / vim-highlightedyank

Make the yanked region apparent!
844 stars 22 forks source link

VIM freezes if changing windows while highlight is active #38

Closed clason closed 6 years ago

clason commented 6 years ago

After the last commit 617ef6ac738be272f4cf35429d39de331ce35fcc, the following leads to a freeze:

  1. Open any file in vi/nvim.
  2. Open a new window (<C-w><C-n>)
  3. Switch to the first window (<c-w><c-w>)
  4. Yank a line (y)
  5. Switch back while the yanked line is still highlighted (<c-w><c-w>)
  6. Wait a while and observe that the highlight does not time out
  7. Switch back and forth a few times (<c-w><c-w>) until vi/nvim freezes.

Changing line 285 in autoload/highlightedyank/highlight.vim to

  return getcmdwintype() isnot# ''

fixes this.

machakann commented 6 years ago

Thanks!