From f0b6e155d4e9e50b29f7087af812a21d7a8c5490 Mon Sep 17 00:00:00 2001 From: "Andy K. Massimino" Date: Sat, 3 Mar 2018 14:57:30 -0500 Subject: [PATCH] Improve version check/warning for matchparen_deferred --- README.md | 3 +++ autoload/matchup/matchparen.vim | 7 ++++++- doc/matchup.txt | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) 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*