diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-08-26 19:52:37 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-08-26 19:52:37 +0200 |
commit | e4a3bcf28d92d0bde9ca227ccb40d401038185e5 (patch) | |
tree | 276387ac4364fdee74b72c2503fc4505e8728043 /runtime/pack/dist/opt/matchit | |
parent | dd74ab9b464f3d1a5f6f6395469b76f8e0e6dccd (diff) |
Updated runtime files. Add Scala files.
Diffstat (limited to 'runtime/pack/dist/opt/matchit')
-rw-r--r-- | runtime/pack/dist/opt/matchit/plugin/matchit.vim | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/runtime/pack/dist/opt/matchit/plugin/matchit.vim b/runtime/pack/dist/opt/matchit/plugin/matchit.vim index 42a6c3e5dd..22acb06130 100644 --- a/runtime/pack/dist/opt/matchit/plugin/matchit.vim +++ b/runtime/pack/dist/opt/matchit/plugin/matchit.vim @@ -1,8 +1,9 @@ " matchit.vim: (global plugin) Extended "%" matching -" Last Change: Fri Jan 25 10:00 AM 2008 EST +" Last Change: 2016 Aug 21 " Maintainer: Benji Fisher PhD <benji@member.AMS.org> " Version: 1.13.2, for Vim 6.3+ " Fix from Fernando Torres included. +" Improvement from Ken Takata included. " URL: http://www.vim.org/script.php?script_id=39 " Documentation: @@ -44,6 +45,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 @@ -121,8 +123,8 @@ function! s:Match_wrapper(word, forward, mode) range execute "let match_words =" b:match_words endif " Thanks to Preben "Peppe" Guldberg and Bram Moolenaar for this suggestion! - if (match_words != s:last_words) || (&mps != s:last_mps) || - \ exists("b:match_debug") + if (match_words != s:last_words) || (&mps != s:last_mps) + \ || exists("b:match_debug") let s:last_mps = &mps " The next several lines were here before " BF started messing with this script. @@ -148,6 +150,10 @@ function! s:Match_wrapper(word, forward, mode) range 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: @@ -192,14 +198,10 @@ function! s:Match_wrapper(word, forward, mode) range " 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) @@ -661,6 +663,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 @@ -668,8 +671,8 @@ fun! s:MultiMatch(spflag, mode) let s:do_BR = 1 let s:pat = s:ParseWords(match_words) endif - let s:all = '\%(' . substitute(s:pat . (strlen(s:pat)?",":"") . default, - \ '[,:]\+','\\|','g') . '\)' + let s:all = '\%(' . substitute(s:pat . (strlen(s:pat) ? "," : "") . default, + \ '[,:]\+', '\\|', 'g') . '\)' if exists("b:match_debug") let b:match_pat = s:pat endif |