qstrahl / vim-matchmaker

Highlight matches for the word under the cursor
38 stars 10 forks source link

Delay the highlight to help speed scrolling #13

Open stephenmm opened 10 years ago

stephenmm commented 10 years ago

It would be nice to be able to delay the highlight so that when you are scrolling quickly through code there is no studdering.

This script is similar to this one and has the delay:

hicursorwords.vim http://www.vim.org/scripts/script.php?script_id=4306

I even tried to hack in the "delay" function from that script into yours but it did not work:

function! s:HiCursorWords__startHilighting()
    let b:HiCursorWords__oldUpdatetime = &updatetime
    let &updatetime = g:HiCursorWords_delay
    augroup HiCursorWordsUpdate
        autocmd!
        autocmd CursorHold,CursorHoldI  *
                \ if exists('b:HiCursorWords__oldUpdatetime') | let &updatetime =     b:HiCursorWords__oldUpdatetime | endif
                \ | call s:HiCursorWords__execute()
    augroup END
endfunction       

So I thought I would ask if you guys knew how to do this or if you could add it to your script.

Thanks for the GREAT script!

qstrahl commented 10 years ago

Hmm... I initially used CursorHold to trigger the highlight, and I can't remember why I switched to CursorMoved, except that I don't want to mess with 'updatetime'. I'll give it some more thought when I can, and I welcome more suggestions on how to solve this problem. Thanks for the input!

noscript commented 10 years ago

I would like to see delayed matching too!

cpixl commented 10 years ago

+1!