mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
vim-patch:8cf29e4c4a2a
runtime(matchit): update matchit plugin to v1.20
fixes: vim/vim#14814
8cf29e4c4a
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
b7782daace
commit
14f9aacc9d
@ -1,6 +1,6 @@
|
|||||||
" matchit.vim: (global plugin) Extended "%" matching
|
" matchit.vim: (global plugin) Extended "%" matching
|
||||||
" autload script of matchit plugin, see ../plugin/matchit.vim
|
" autload script of matchit plugin, see ../plugin/matchit.vim
|
||||||
" Last Change: Jan 24, 2022
|
" Last Change: May 20, 2024
|
||||||
|
|
||||||
" Neovim does not support scriptversion
|
" Neovim does not support scriptversion
|
||||||
if has("vimscript-4")
|
if has("vimscript-4")
|
||||||
@ -87,9 +87,9 @@ function matchit#Match_wrapper(word, forward, mode) range
|
|||||||
let s:last_mps = &mps
|
let s:last_mps = &mps
|
||||||
" quote the special chars in 'matchpairs', replace [,:] with \| and then
|
" quote the special chars in 'matchpairs', replace [,:] with \| and then
|
||||||
" append the builtin pairs (/*, */, #if, #ifdef, #ifndef, #else, #elif,
|
" append the builtin pairs (/*, */, #if, #ifdef, #ifndef, #else, #elif,
|
||||||
" #endif)
|
" #elifdef, #elifndef, #endif)
|
||||||
let default = escape(&mps, '[$^.*~\\/?]') .. (strlen(&mps) ? "," : "") ..
|
let default = escape(&mps, '[$^.*~\\/?]') .. (strlen(&mps) ? "," : "") ..
|
||||||
\ '\/\*:\*\/,#\s*if\%(n\=def\)\=:#\s*else\>:#\s*elif\>:#\s*endif\>'
|
\ '\/\*:\*\/,#\s*if\%(n\=def\)\=:#\s*else\>:#\s*elif\%(n\=def\)\=\>:#\s*endif\>'
|
||||||
" s:all = pattern with all the keywords
|
" s:all = pattern with all the keywords
|
||||||
let match_words = match_words .. (strlen(match_words) ? "," : "") .. default
|
let match_words = match_words .. (strlen(match_words) ? "," : "") .. default
|
||||||
let s:last_words = match_words
|
let s:last_words = match_words
|
||||||
@ -101,6 +101,8 @@ function matchit#Match_wrapper(word, forward, mode) range
|
|||||||
let s:pat = s:ParseWords(match_words)
|
let s:pat = s:ParseWords(match_words)
|
||||||
endif
|
endif
|
||||||
let s:all = substitute(s:pat, s:notslash .. '\zs[,:]\+', '\\|', 'g')
|
let s:all = substitute(s:pat, s:notslash .. '\zs[,:]\+', '\\|', 'g')
|
||||||
|
" un-escape \, to ,
|
||||||
|
let s:all = substitute(s:all, '\\,', ',', 'g')
|
||||||
" Just in case there are too many '\(...)' groups inside the pattern, make
|
" Just in case there are too many '\(...)' groups inside the pattern, make
|
||||||
" sure to use \%(...) groups, so that error E872 can be avoided
|
" sure to use \%(...) groups, so that error E872 can be avoided
|
||||||
let s:all = substitute(s:all, '\\(', '\\%(', 'g')
|
let s:all = substitute(s:all, '\\(', '\\%(', 'g')
|
||||||
@ -112,6 +114,8 @@ function matchit#Match_wrapper(word, forward, mode) range
|
|||||||
let s:patBR = substitute(match_words .. ',',
|
let s:patBR = substitute(match_words .. ',',
|
||||||
\ s:notslash .. '\zs[,:]*,[,:]*', ',', 'g')
|
\ s:notslash .. '\zs[,:]*,[,:]*', ',', 'g')
|
||||||
let s:patBR = substitute(s:patBR, s:notslash .. '\zs:\{2,}', ':', 'g')
|
let s:patBR = substitute(s:patBR, s:notslash .. '\zs:\{2,}', ':', 'g')
|
||||||
|
" un-escape \, to ,
|
||||||
|
let s:patBR = substitute(s:patBR, '\\,', ',', 'g')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Second step: set the following local variables:
|
" Second step: set the following local variables:
|
||||||
@ -534,6 +538,8 @@ fun! s:Choose(patterns, string, comma, branch, prefix, suffix, ...)
|
|||||||
else
|
else
|
||||||
let currpat = substitute(current, s:notslash .. a:branch, '\\|', 'g')
|
let currpat = substitute(current, s:notslash .. a:branch, '\\|', 'g')
|
||||||
endif
|
endif
|
||||||
|
" un-escape \, to ,
|
||||||
|
let currpat = substitute(currpat, '\\,', ',', 'g')
|
||||||
while a:string !~ a:prefix .. currpat .. a:suffix
|
while a:string !~ a:prefix .. currpat .. a:suffix
|
||||||
let tail = strpart(tail, i)
|
let tail = strpart(tail, i)
|
||||||
let i = matchend(tail, s:notslash .. a:comma)
|
let i = matchend(tail, s:notslash .. a:comma)
|
||||||
|
@ -4,7 +4,7 @@ For instructions on installing this file, type
|
|||||||
`:help matchit-install`
|
`:help matchit-install`
|
||||||
inside Vim.
|
inside Vim.
|
||||||
|
|
||||||
For Vim version 9.0. Last change: 2023 June 28
|
For Vim version 9.1. Last change: 2024 May 20
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Benji Fisher et al
|
VIM REFERENCE MANUAL by Benji Fisher et al
|
||||||
@ -176,8 +176,8 @@ defined automatically.
|
|||||||
|
|
||||||
2.1 Temporarily disable the matchit plugin *matchit-disable* *:MatchDisable*
|
2.1 Temporarily disable the matchit plugin *matchit-disable* *:MatchDisable*
|
||||||
|
|
||||||
To temporarily reset the plugins, that are setup you can run the following
|
To temporarily disable the matchit plugin, after it hat been loaded,
|
||||||
command: >
|
execute this command: >
|
||||||
:MatchDisable
|
:MatchDisable
|
||||||
|
|
||||||
This will delete all the defined key mappings to the Vim default.
|
This will delete all the defined key mappings to the Vim default.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" matchit.vim: (global plugin) Extended "%" matching
|
" matchit.vim: (global plugin) Extended "%" matching
|
||||||
" Maintainer: Christian Brabandt
|
" Maintainer: Christian Brabandt
|
||||||
" Version: 1.19
|
" Version: 1.20
|
||||||
" Last Change: 2023, June 28th
|
" Last Change: 2024 May 20
|
||||||
" Repository: https://github.com/chrisbra/matchit
|
" Repository: https://github.com/chrisbra/matchit
|
||||||
" Previous URL:http://www.vim.org/script.php?script_id=39
|
" Previous URL:http://www.vim.org/script.php?script_id=39
|
||||||
" Previous Maintainer: Benji Fisher PhD <benji@member.AMS.org>
|
" Previous Maintainer: Benji Fisher PhD <benji@member.AMS.org>
|
||||||
|
Loading…
Reference in New Issue
Block a user