Tony wrote:
> Not sure how easy this will be to fix; I just noticed it. Also not > sure of whether the problem is in matchit.vim, in > $VIMRUNTIME/ftplugin/vim.vim, or in both. > > Software in use: > Vim or gvim, Big version, 8.2.1296 > $VIMRUNTIME/pack/dist/opt/matchit/plugin/matchit.vim version 1.17 > dated 2019 Oct 24 > $VIMRUNTIME/pack/dist/opt/matchit/autoload/matchit.vim (Last change > Mar 01, 2020) > $VIMRUNTIME/ftplugin/vim.vim (Last change 2020 Jul 06) > > The bug is exhibited, for example, when viewing the CSApprox.vim > plugin version 4.00 dated 14 Sep 2012; this is the latest version at > vim.org: https://www.vim.org/scripts/script.php?script_id=2390 > On my installation: ~/.vim/plugin/CSApprox.vim line 437 > > With matchit enabled, when viewing a Vim script where the function() > function is used within the range of a function definition (between > :function and :endfunction), hiting % on that :endfunction statement > goes to the function() invocation and vice-versa; hitting % on that > :function command does nothing. > > The problem is of course due to the fact that b:match_words (for the > "vim" filetype) recognises "function" but does not skip "function(". > > I'm attaching a proposed patch. Please check it, I haven't written > complex regular expressions in a long time. Thanks for pointing out. I think a simpler way is to add [^(], that is: match anything but a paren. A quick test shows that this works. -- How many light bulbs does it take to change a person? /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202007261442.06QEgrob611871%40masaka.moolenaar.net.
