# HG changeset patch # User Christian Brabandt # Date 1698078606 -7200 # Node ID 2d44cd7117fbcaaaf1d808de04b02b1ebf40312a # Parent 1c0411e555a26b72ec570b2e584f30ded30412d6 runtime(vim): Update ftplugin - comment motions (#13412) Commit: https://github.com/vim/vim/commit/fea96c00e55a71e3007907ff4f7ad513bb9ff0eb Author: dkearns Date: Tue Oct 24 03:16:44 2023 +1100 runtime(vim): Update ftplugin - comment motions (https://github.com/vim/vim/issues/13412) Fix the pattern used by comment-motion mappings to match the start of a block comment. Block-comment start lines were being ignored if the previous line contained a double-quote character anywhere in the line. Line comments should only be ignored if the previous line is a full-line comment and, therefore, part of the current block comment. Signed-off-by: Christian Brabandt diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -85,8 +85,8 @@ if !exists("no_plugin_maps") && !exists( vnoremap ][ m':exe "normal! gv"call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "W") " Move around comments - nnoremap ]" :call search('^\(\s*".*\n\)\@ - vnoremap ]" :exe "normal! gv"call search('^\(\s*".*\n\)\@ + nnoremap ]" :call search('\%(^\s*".*\n\)\@ + vnoremap ]" :exe "normal! gv"call search('\%(^\s*".*\n\)\@ nnoremap [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW") vnoremap [" :exe "normal! gv"call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW") endif