Try not to show off-screen matches while "scrolling"

This commit is contained in:
Andy K. Massimino
2017-12-18 13:56:05 -05:00
parent 7c80951463
commit 36e347e8aa

View File

@@ -239,8 +239,14 @@ function! s:matchparen.highlight(...) abort dict " {{{1
" store flag meaning highlighting is active
let w:matchup_need_clear = 1
" disable off-screen when scrolling with j/k
let l:scrolling = winheight(0) > 2*&scrolloff
\ && (line('.') == line('w$')-&scrolloff
\ || line('.') == line('w0')+&scrolloff)
" show off-screen matches
if g:matchup_matchparen_status_offscreen && !l:current.skip
\ && (!l:scrolling || g:matchup_matchparen_deferred)
call matchup#matchparen#offscreen(l:current)
endif