mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Let off-screen matching work at screen edge, closes #28
This commit is contained in:
@@ -21,6 +21,7 @@ function! s:init_options()
|
||||
call s:init_option('matchup_matchparen_enabled',
|
||||
\ !(&t_Co < 8 && !has('gui_running')))
|
||||
call s:init_option('matchup_matchparen_status_offscreen', 1)
|
||||
call s:init_option('matchup_matchparen_scrolloff', 0)
|
||||
call s:init_option('matchup_matchparen_singleton', 0)
|
||||
call s:init_option('matchup_matchparen_deferred', 0)
|
||||
call s:init_option('matchup_matchparen_deferred_show_delay', 50)
|
||||
|
||||
@@ -299,13 +299,14 @@ function! s:matchparen.highlight(...) abort dict " {{{1
|
||||
let w:matchup_need_clear = 1
|
||||
|
||||
" disable off-screen when scrolling with j/k
|
||||
let l:scrolling = winheight(0) > 2*&scrolloff
|
||||
let l:scrolling = g:matchup_matchparen_scrolloff
|
||||
\ && 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)
|
||||
if g:matchup_matchparen_status_offscreen
|
||||
\ && !l:current.skip && !l:scrolling
|
||||
call matchup#matchparen#offscreen(l:current)
|
||||
endif
|
||||
|
||||
|
||||
@@ -538,6 +538,14 @@ Module matchparen~
|
||||
|
||||
Default: 1
|
||||
|
||||
*g:matchup_matchparen_scrolloff*
|
||||
|
||||
When enabled, off-screen matches will not be shown in the statusline
|
||||
while the cursor is at the screen edge (respects the value of 'scrolloff').
|
||||
This is intended to prevent flickering while scrolling with j and k.
|
||||
|
||||
Default: 0
|
||||
|
||||
*g:matchup_matchparen_stopline*
|
||||
|
||||
The number of lines to search in either direction while highlighting
|
||||
|
||||
Reference in New Issue
Block a user