Update runtime files.
diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim
index 2965ad1..0fdfef1 100644
--- a/runtime/plugin/matchparen.vim
+++ b/runtime/plugin/matchparen.vim
@@ -1,6 +1,6 @@
" Vim plugin for showing matching parens
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2013 Mar 19
+" Last Change: 2013 May 08
" Exit quickly when:
" - this plugin was already loaded (or disabled)
@@ -11,6 +11,13 @@
endif
let g:loaded_matchparen = 1
+if !exists("g:matchparen_timeout")
+ let g:matchparen_timeout = 300
+endif
+if !exists("g:matchparen_insert_timeout")
+ let g:matchparen_insert_timeout = 60
+endif
+
augroup matchparen
" Replace all matchparen autocommands
autocmd! CursorMoved,CursorMovedI,WinEnter * call s:Highlight_Matching_Pair()
@@ -99,10 +106,15 @@
let stopline = stoplinetop
endif
+ " Limit the search time to 300 msec to avoid a hang on very long lines.
+ " This fails when a timeout is not supported.
+ if mode() == 'i' || mode() == 'R'
+ let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
+ else
+ let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
+ endif
try
- " Limit the search time to 300 msec to avoid a hang on very long lines.
- " This fails when a timeout is not supported.
- let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 300)
+ let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout)
catch /E118/
" Can't use the timeout, restrict the stopline a bit more to avoid taking
" a long time on closed folds and long lines.