Bram, there is a bug in the matchit plugin. It makes use of the v:count1 variable in the function s:MultiMatch(). However when it accesses the variable, it might be reset from the previous normal mode commands for restoring the cursor position. So save it a little bit earlier:
diff --git a/runtime/pack/dist/opt/matchit/plugin/matchit.vim b/runtime/pack/dist/opt/matchit/plugin/matchit.vim index 4c9b845..7165067 100644 --- a/runtime/pack/dist/opt/matchit/plugin/matchit.vim +++ b/runtime/pack/dist/opt/matchit/plugin/matchit.vim @@ -704,6 +704,8 @@ fun! s:MultiMatch(spflag, mode) let skip = 's:comment\|string' endif let skip = s:ParseSkip(skip) + " save v:count1 variable, might be reset from the restore_cursor command + let level = v:count1 " let restore_cursor = line(".") . "G" . virtcol(".") . "|" " normal! H " let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor @@ -726,7 +728,6 @@ fun! s:MultiMatch(spflag, mode) execute "if " . skip . "| let skip = '0' | endif" endif mark ' - let level = v:count1 while level if searchpair(openpat, '', closepat, a:spflag, skip) < 1 call s:CleanUp(restore_options, a:mode, startline, startcol) CC'ing Benji, not sure if he reads his mail, I haven't heard from him in a long while. Best, Christian -- Besser heimlich schlau als unheimlich blöd. -- -- 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 vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.