0
0
mirror of https://github.com/vim/vim.git synced 2025-11-15 23:14:06 -05:00

runtime(help): Update syntax, match tables at :help :digraph-table

Match the digraph tables to avoid false positive matches for helpSpecial
etc.  No syntax groups should match in these tables.

closes: #18738

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns
2025-11-13 20:59:44 +00:00
committed by Christian Brabandt
parent 8cb4505ec6
commit 8644c3b7e6
4 changed files with 81 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Vim help file
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2025 Oct 19
" Last Change: 2025 Nov 13
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Quit when a (custom) syntax file was already loaded
@@ -62,20 +62,6 @@ if has_key(g:help_example_languages, "vim9")
syn cluster helpExampleHighlight_vim9 add=vim9LegacyHeader_HelpExample
endif
" builtin.txt
syn region helpReturnType
\ start="^\t\tReturn type: "
\ end="^$"
\ contains=@vimType,helpHyperTextJump,helpSpecial
\ transparent
syn match helpSpecial contained "{type}" containedin=vimCompoundType
" various.txt
syn region helpExCommand_Version
\ start="^:ve\[rsion]\t\t"
\ end="\n\ze\n:ve\[rsion] {nr}"
\ contains=helpHyperTextEntry,helpHyperTextJump,helpOption
if has("ebcdic")
syn match helpHyperTextJump "\\\@<!|[^"*|]\+|" contains=helpBar
syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1 contains=helpStar
@@ -229,6 +215,26 @@ syn match helpDiffAdded "\t[* ]Added\t\+[a-z].*"
syn match helpDiffChanged "\t[* ]Changed\t\+[a-z].*"
syn match helpDiffRemoved "\t[* ]Removed\t\+[a-z].*"
" builtin.txt
syn region helpReturnType
\ start="^\t\tReturn type: "
\ end="^$"
\ contains=@vimType,helpHyperTextJump,helpSpecial
\ transparent
syn match helpSpecial contained "{type}" containedin=vimCompoundType
" digraph.txt
syn region helpDigraphTable
\ start="*digraph-table\%(-mbyte\)\=\*"
\ end="^$"
\ contains=helpHyperTextEntry,helpHeader
" various.txt
syn region helpExCommand_Version
\ start="^:ve\[rsion]\t\t"
\ end="\n\ze\n:ve\[rsion] {nr}"
\ contains=helpHyperTextEntry,helpHyperTextJump,helpOption
" Additionally load a language-specific syntax file "help_ab.vim".
let s:i = match(expand("%"), '\.\a\ax$')
if s:i > 0
@@ -238,7 +244,6 @@ unlet s:i
syn sync minlines=40
" Define the default highlighting.
" Only used when an item doesn't have highlighting yet
hi def link helpIgnore Ignore