runtime(syntax-tests): Add :help command termination tests

Problem:  The :help command lacks command termination tests.
Solution: Add tests for command termination at "|", "^M" and "^J".

- Check special handling of "|" in arguments.
- Update the Vim syntax file.

closes: #18932

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns
2026-01-11 18:25:38 +00:00
committed by Christian Brabandt
parent 1e54023673
commit c4dc4d8f1e
9 changed files with 83 additions and 41 deletions

View File

@@ -2,7 +2,7 @@
" Language: Vim script
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
" Doug Kearns <dougkearns@gmail.com>
" Last Change: 2025 Dec 04
" Last Change: 2026 Jan 11
" Former Maintainer: Charles E. Campbell
" DO NOT CHANGE DIRECTLY.
@@ -1462,10 +1462,10 @@ syn match vimHelp "\<h\%[elp]\>" skipwhite nextgroup=vimHelpBang,vimHelpArg,vimH
syn region vimHelpArg contained
\ start="\S"
\ matchgroup=Special
\ end="\%(@\a\a\)\=\ze\s*\%($\|\%x0d\|\%x00\||\s*\S\)"
\ end="\%(@\a\a\)\=\ze\s*\%($\|\%x0d\|\%x00\||[^|]\)"
\ oneline
syn match vimHelpNextCommand contained "\ze|[^|]" skipwhite nextgroup=vimCmdSep
syn match vimHelpBang contained "\a\@1<=!" skipwhite nextgroup=vimHelpArg,vimHelpNextCommand
syn match vimHelpNextCommand contained "\ze|\s*\S" skipwhite nextgroup=vimCmdSep
syn match vimHelpgrep "\<l\=helpg\%[rep]\>" skipwhite nextgroup=vimHelpgrepBang,vimHelpgrepPattern
syn region vimHelpgrepPattern contained