Skip to content

Commit

Permalink
Improve version check/warning for matchparen_deferred
Browse files Browse the repository at this point in the history
  • Loading branch information
andymass committed Mar 3, 2018
1 parent 660cb1a commit f0b6e15
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ let g:matchup_matchparen_deferred = 1
```
default: 0 (disabled)

Note: this feature is only available if your vim version has `timers` and
the function `timer_pause` (version 7.4.2180 and after).

Adjust timeouts in milliseconds for deferred highlighting:
```vim
let g:matchparen_matchparen_deferred_show_time = 50
Expand Down
7 changes: 6 additions & 1 deletion autoload/matchup/matchparen.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ endfunction
" }}}1

function! matchup#matchparen#enable() " {{{1
if !has('timers')
if g:matchup_matchparen_deferred
\ && (!has('timers') || !exists('*timer_pause'))
let g:matchup_matchparen_deferred = 0
echohl WarningMsg
echom "match-up's deferred highlighting feature is "
\ . 'not supported in your vim version'
echohl None
endif

augroup matchup_matchparen
Expand Down
3 changes: 3 additions & 0 deletions doc/matchup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,9 @@ Module matchparen~

Default: 0 (disabled)

Note: this feature is only available if your vim version has |timers| and
the function |timer_pause| (version 7.4.2180 and after).

*g:matchparen_matchparen_deferred_show_time*
*g:matchparen_matchparen_deferred_hide_time*

Expand Down

0 comments on commit f0b6e15

Please sign in to comment.