From e606604322815abd3dc91a5595a0aa976a9aded7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 23 Oct 2023 18:20:12 +0200 Subject: [PATCH] vim-patch:fea96c00e55a runtime(vim): Update ftplugin - comment motions (vim/vim#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. https://github.com/vim/vim/commit/fea96c00e55a71e3007907ff4f7ad513bb9ff0eb Co-authored-by: dkearns --- 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 3b10c95c80..06369e8a82 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -84,8 +84,8 @@ if !exists("no_plugin_maps") && !exists("no_vim_maps") vnoremap ][ m':exe "normal! gv"call search('^\s*end\(f\%[unction]\\|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