mirror of
https://github.com/neovim/neovim.git
synced 2026-07-22 00:51:33 +00:00
vim-patch:ec46b9d: runtime(matchit): include minor improvement from chrisbra/matchit
In particular, documentation update from
related: chrisbra/matchit#55
ec46b9d4f2
Co-authored-by: Jon Parise <jon@indelible.org>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
" matchit.vim: (global plugin) Extended "%" matching
|
||||
" autload script of matchit plugin, see ../plugin/matchit.vim
|
||||
" Last Change: Jan 06, 2025
|
||||
" Last Change: Jan 09, 2026
|
||||
|
||||
" Neovim does not support scriptversion
|
||||
if has("vimscript-4")
|
||||
@@ -71,9 +71,8 @@ function matchit#Match_wrapper(word, forward, mode) range
|
||||
|
||||
" Check for custom match function hook
|
||||
if exists("b:match_function")
|
||||
let MatchFunc = b:match_function
|
||||
try
|
||||
let result = call(MatchFunc, [a:forward])
|
||||
let result = call(b:match_function, [a:forward])
|
||||
if !empty(result)
|
||||
call cursor(result)
|
||||
return s:CleanUp(restore_options, a:mode, startpos)
|
||||
|
||||
@@ -286,8 +286,8 @@ Python example (simplified): >
|
||||
let pattern = get(s:keywords, keyword, '')
|
||||
if empty(pattern) | return [] | endif
|
||||
|
||||
let flags = a:forward ? 'nW' : 'nbW'
|
||||
let [lnum, col] = searchpos('^\s*\%(' . pattern . '\)\>', flags, 0, 0,
|
||||
" Forward-only. Backwards left as an exercise for the reader.
|
||||
let [lnum, col] = searchpos('^\s*\%(' . pattern . '\)\>', 'nW' 0, 0,
|
||||
\ 'indent(".") != ' . indent('.'))
|
||||
return lnum > 0 ? [lnum, col] : []
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user