Mercurial > vim
changeset 33638:2d44cd7117fb
runtime(vim): Update ftplugin - comment motions (#13412)
Commit: https://github.com/vim/vim/commit/fea96c00e55a71e3007907ff4f7ad513bb9ff0eb
Author: dkearns <dougkearns@gmail.com>
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 <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 23 Oct 2023 18:30:06 +0200 |
parents | 1c0411e555a2 |
children | d6aa977fc4a9 |
files | runtime/ftplugin/vim.vim |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -85,8 +85,8 @@ if !exists("no_plugin_maps") && !exists( vnoremap <silent><buffer> ][ m':<C-U>exe "normal! gv"<Bar>call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "W")<CR> " Move around comments - nnoremap <silent><buffer> ]" :call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR> - vnoremap <silent><buffer> ]" :<C-U>exe "normal! gv"<Bar>call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR> + nnoremap <silent><buffer> ]" :call search('\%(^\s*".*\n\)\@<!\%(^\s*"\)', "W")<CR> + vnoremap <silent><buffer> ]" :<C-U>exe "normal! gv"<Bar>call search('\%(^\s*".*\n\)\@<!\%(^\s*"\)', "W")<CR> nnoremap <silent><buffer> [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR> vnoremap <silent><buffer> [" :<C-U>exe "normal! gv"<Bar>call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR> endif