From e2f98b95c8071f772695602cd4f714dc588eb8e7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 29 Mar 2006 21:18:24 +0000 Subject: updated for version 7.0c03 --- runtime/plugin/matchparen.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index c8d6f9b92f..57505179cc 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -1,6 +1,6 @@ " Vim plugin for showing matching parens " Maintainer: Bram Moolenaar -" Last Change: 2006 Mar 14 +" Last Change: 2006 Mar 29 " Exit quickly when: " - this plugin was already loaded (or disabled) @@ -63,15 +63,22 @@ function! s:Highlight_Matching_Pair() " Figure out the arguments for searchpairpos(). " Restrict the search to visible lines with "stopline". + " And avoid searching very far (e.g., for closed folds) if i % 2 == 0 let s_flags = 'nW' let c2 = plist[i + 1] let stopline = line('w$') + if stopline > c_lnum + 100 + let stopline = c_lnu + 100 + endif else let s_flags = 'nbW' let c2 = c let c = plist[i - 1] let stopline = line('w0') + if stopline < c_lnum - 100 + let stopline = c_lnu - 100 + endif endif if c == '[' let c = '\[' -- cgit v1.2.3