diff options
author | dkearns <dougkearns@gmail.com> | 2023-10-24 03:16:44 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-23 18:16:44 +0200 |
commit | fea96c00e55a71e3007907ff4f7ad513bb9ff0eb (patch) | |
tree | f01cf1259522f0a8ed0b46358ef36a97e67a4f04 /runtime/ftplugin | |
parent | 0ab500dede4edd8d5aee7ddc63444537be527871 (diff) |
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 <cb@256bit.org>
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/vim.vim | 4 |
1 files 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 <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 |