Hi list and Benji,

The matchit plugin doesn't respect the 'matchpairs' option sometimes.
E.g. When editing an html file, cannot jump between a pair of parentheses
with %.

Attached patch fixes the problem.  The basic idea is came from tmhedberg's
fix (https://github.com/tmhedberg/matchit), but I changed it slightly to cache
some more patterns.

Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent  077648d48f92ba3df877cba48d6142f2ae5ee6a1

diff --git a/runtime/macros/matchit.vim b/runtime/macros/matchit.vim
--- a/runtime/macros/matchit.vim
+++ b/runtime/macros/matchit.vim
@@ -43,6 +43,7 @@ endif
 let loaded_matchit = 1
 let s:last_mps = ""
 let s:last_words = ":"
+let s:patBR = ""
 
 let s:save_cpo = &cpo
 set cpo&vim
@@ -147,6 +148,10 @@ function! s:Match_wrapper(word, forward,
     if exists("b:match_debug")
       let b:match_pat = s:pat
     endif
+    " Reconstruct the version with unresolved backrefs.
+    let s:patBR = substitute(match_words.',',
+      \ s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
+    let s:patBR = substitute(s:patBR, s:notslash.'\zs:\{2,}', ':', 'g')
   endif
 
   " Second step:  set the following local variables:
@@ -191,14 +196,10 @@ function! s:Match_wrapper(word, forward,
   " group = colon-separated list of patterns, one of which matches
   "       = ini:mid:fin or ini:fin
   "
-  " Reconstruct the version with unresolved backrefs.
-  let patBR = substitute(match_words.',',
-    \ s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
-  let patBR = substitute(patBR, s:notslash.'\zs:\{2,}', ':', 'g')
   " Now, set group and groupBR to the matching group: 'if:endif' or
   " 'while:endwhile' or whatever.  A bit of a kluge:  s:Choose() returns
   " group . "," . groupBR, and we pick it apart.
-  let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR)
+  let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, s:patBR)
   let i = matchend(group, s:notslash . ",")
   let groupBR = strpart(group, i)
   let group = strpart(group, 0, i-1)
@@ -660,6 +661,7 @@ fun! s:MultiMatch(spflag, mode)
     \ exists("b:match_debug")
     let s:last_words = match_words
     let s:last_mps = &mps
+    let match_words = match_words . (strlen(match_words) ? "," : "") . default
     if match_words !~ s:notslash . '\\\d'
       let s:do_BR = 0
       let s:pat = match_words

Raspunde prin e-mail lui