From a92822835521574710a830a7de0e692bf7517fb8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 14 Apr 2024 07:35:08 +0800 Subject: vim-patch:ce06493aeb3d (#28321) runtime(vim): Update base-syntax, add legacy header folding Allow for syntax-based folding of Vim9 script legacy header regions. This is enabled with the "H" flag of the g:vimsyn_folding config variable. closes: vim/vim#14530 https://github.com/vim/vim/commit/ce06493aeb3d198d13de289ac39d1ed0f1604429 Co-authored-by: Doug Kearns --- runtime/syntax/vim.vim | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 4de9cb1425..75292b0445 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -69,7 +69,7 @@ syn case match " Special Vim Highlighting (not automatic) {{{1 " Set up folding commands for this syntax highlighting file {{{2 -if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhlmpPrt]' +if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhHlmpPrt]' if g:vimsyn_folding =~# 'a' com! -nargs=* VimFolda fold else @@ -85,6 +85,11 @@ if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhlmpPrt]' else com! -nargs=* VimFoldh endif + if g:vimsyn_folding =~# 'H' + com! -nargs=* VimFoldH fold + else + com! -nargs=* VimFoldH + endif if g:vimsyn_folding =~# 'l' com! -nargs=* VimFoldl fold else @@ -119,6 +124,7 @@ else com! -nargs=* VimFolda com! -nargs=* VimFoldf com! -nargs=* VimFoldh + com! -nargs=* VimFoldH com! -nargs=* VimFoldl com! -nargs=* VimFoldm com! -nargs=* VimFoldp @@ -820,11 +826,11 @@ syn region vimGlobal matchgroup=Statement start='\