diff --git a/README.md b/README.md index 296b46b..471a2ca 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/autoload/matchup/matchparen.vim b/autoload/matchup/matchparen.vim index abd05ee..dcca044 100644 --- a/autoload/matchup/matchparen.vim +++ b/autoload/matchup/matchparen.vim @@ -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 diff --git a/doc/matchup.txt b/doc/matchup.txt index bdf74e1..862717a 100644 --- a/doc/matchup.txt +++ b/doc/matchup.txt @@ -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*