From fea96c00e55a71e3007907ff4f7ad513bb9ff0eb Mon Sep 17 00:00:00 2001 From: dkearns Date: Tue, 24 Oct 2023 03:16:44 +1100 Subject: [PATCH] runtime(vim): Update ftplugin - comment motions (#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 --- runtime/ftplugin/vim.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index e25054ba89..1d340e475b 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -85,8 +85,8 @@ if !exists("no_plugin_maps") && !exists("no_vim_maps") 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