Skip to content

Commit 8644c3b

Browse files
dkearnschrisbra
authored andcommitted
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 <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 8cb4505 commit 8644c3b

File tree

4 files changed

+81
-16
lines changed

4 files changed

+81
-16
lines changed

runtime/syntax/help.vim

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim syntax file
22
" Language: Vim help file
33
" Maintainer: Doug Kearns <[email protected]>
4-
" Last Change: 2025 Oct 19
4+
" Last Change: 2025 Nov 13
55
" Former Maintainer: Bram Moolenaar <[email protected]>
66

77
" Quit when a (custom) syntax file was already loaded
@@ -62,20 +62,6 @@ if has_key(g:help_example_languages, "vim9")
6262
syn cluster helpExampleHighlight_vim9 add=vim9LegacyHeader_HelpExample
6363
endif
6464

65-
" builtin.txt
66-
syn region helpReturnType
67-
\ start="^\t\tReturn type: "
68-
\ end="^$"
69-
\ contains=@vimType,helpHyperTextJump,helpSpecial
70-
\ transparent
71-
syn match helpSpecial contained "{type}" containedin=vimCompoundType
72-
73-
" various.txt
74-
syn region helpExCommand_Version
75-
\ start="^:ve\[rsion]\t\t"
76-
\ end="\n\ze\n:ve\[rsion] {nr}"
77-
\ contains=helpHyperTextEntry,helpHyperTextJump,helpOption
78-
7965
if has("ebcdic")
8066
syn match helpHyperTextJump "\\\@<!|[^"*|]\+|" contains=helpBar
8167
syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1 contains=helpStar
@@ -229,6 +215,26 @@ syn match helpDiffAdded "\t[* ]Added\t\+[a-z].*"
229215
syn match helpDiffChanged "\t[* ]Changed\t\+[a-z].*"
230216
syn match helpDiffRemoved "\t[* ]Removed\t\+[a-z].*"
231217

218+
" builtin.txt
219+
syn region helpReturnType
220+
\ start="^\t\tReturn type: "
221+
\ end="^$"
222+
\ contains=@vimType,helpHyperTextJump,helpSpecial
223+
\ transparent
224+
syn match helpSpecial contained "{type}" containedin=vimCompoundType
225+
226+
" digraph.txt
227+
syn region helpDigraphTable
228+
\ start="*digraph-table\%(-mbyte\)\=\*"
229+
\ end="^$"
230+
\ contains=helpHyperTextEntry,helpHeader
231+
232+
" various.txt
233+
syn region helpExCommand_Version
234+
\ start="^:ve\[rsion]\t\t"
235+
\ end="\n\ze\n:ve\[rsion] {nr}"
236+
\ contains=helpHyperTextEntry,helpHyperTextJump,helpOption
237+
232238
" Additionally load a language-specific syntax file "help_ab.vim".
233239
let s:i = match(expand("%"), '\.\a\ax$')
234240
if s:i > 0
@@ -238,7 +244,6 @@ unlet s:i
238244

239245
syn sync minlines=40
240246

241-
242247
" Define the default highlighting.
243248
" Only used when an item doesn't have highlighting yet
244249
hi def link helpIgnore Ignore
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
> +0&#ffffff0@74
2+
@56|*+0#ffffff16&|d+0#e000002&|i|g|r|a|p|h|-|t|a|b|l|e|*+0#ffffff16&| +0#0000000&@3
3+
|c+0#e000e06&|h|a|r| @1|d|i|g|r|a|p|h| @2|h|e|x| @4|d|e|c| @4|o|f@1|i|c|i|a|l| |n|a|m|e| +0#ffffff16&|~| +0#0000000&@27
4+
|^|@| @5|N|U| @5|0|x|0@1| @5|0| @4|N|U|L@1| |(|N|U|L|)| @32
5+
|^|A| @5|S|H| @5|0|x|0|1| @5|1| @4|S|T|A|R|T| |O|F| |H|E|A|D|I|N|G| |(|S|O|H|)| @20
6+
|^|B| @5|S|X| @5|0|x|0|2| @5|2| @4|S|T|A|R|T| |O|F| |T|E|X|T| |(|S|T|X|)| @23
7+
|^|C| @5|E|X| @5|0|x|0|3| @5|3| @4|E|N|D| |O|F| |T|E|X|T| |(|E|T|X|)| @25
8+
|^|D| @5|E|T| @5|0|x|0|4| @5|4| @4|E|N|D| |O|F| |T|R|A|N|S|M|I|S@1|I|O|N| |(|E|O|T|)| @17
9+
|^|E| @5|E|Q| @5|0|x|0|5| @5|5| @4|E|N|Q|U|I|R|Y| |(|E|N|Q|)| @29
10+
|^|F| @5|A|K| @5|0|x|0|6| @5|6| @4|A|C|K|N|O|W|L|E|D|G|E| |(|A|C|K|)| @25
11+
|^|G| @5|B|L| @5|0|x|0|7| @5|7| @4|B|E|L@1| |(|B|E|L|)| @32
12+
|^|H| @5|B|S| @5|0|x|0|8| @5|8| @4|B|A|C|K|S|P|A|C|E| |(|B|S|)| @28
13+
|^|I| @5|H|T| @5|0|x|0|9| @5|9| @4|C|H|A|R|A|C|T|E|R| |T|A|B|U|L|A|T|I|O|N| |(|H|T|)| @17
14+
|Ñ| @6|N|?| @5|0|x|d|1| @3|2|0|9| @4|L|A|T|I|N| |C|A|P|I|T|A|L| |L|E|T@1|E|R| |N| |W|I|T|H| |T|I|L|D|E| @9
15+
@75
16+
|I|f| |y|o|u| |a|r|e| |u|s|i|n|g| |a| ||+0#ffffff16&|m+0#00e0e07&|u|l|t|i|b|y|t|e||+0#ffffff16&| +0#0000000&|'+0#00e0003&|e|n|c|o|d|i|n|g|'|,+0#0000000&| |V|i|m| |p|r|o|v|i|d|e|s| |t|h|i|s| |e|n|h|a|n|c|e|d| |s|e|t| |o
17+
|f| @73
18+
|a|d@1|i|t|i|o|n|a|l| |d|i|g|r|a|p|h|s|:| @54
19+
@75
20+
@57|1|,|0|-|1| @8|T|o|p|
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
|Ñ+0&#ffffff0| @6|N|?| @5|0|x|d|1| @3|2|0|9| @4|L|A|T|I|N| |C|A|P|I|T|A|L| |L|E|T@1|E|R| |N| |W|I|T|H| |T|I|L|D|E| @9
2+
@75
3+
|I|f| |y|o|u| |a|r|e| |u|s|i|n|g| |a| ||+0#ffffff16&|m+0#00e0e07&|u|l|t|i|b|y|t|e||+0#ffffff16&| +0#0000000&|'+0#00e0003&|e|n|c|o|d|i|n|g|'|,+0#0000000&| |V|i|m| |p|r|o|v|i|d|e|s| |t|h|i|s| |e|n|h|a|n|c|e|d| |s|e|t| |o
4+
|f| @73
5+
|a|d@1|i|t|i|o|n|a|l| |d|i|g|r|a|p|h|s|:| @54
6+
> @74
7+
@56|*+0#ffffff16&|d+0#e000002&|i|g|r|a|p|h|-|t|a|b|l|e|-|m|b|y|t
8+
|e|*+0#ffffff16&| +0#0000000&@72
9+
|c|h|a|r| @1|d|i|g|r|a|p|h| @2|h|e|x| @4|d|e|c| @4|o|f@1|i|c|i|a|l| |n|a|m|e| @29
10+
|Ā| @6|A|-| @5|0|1|0@1| @3|0|2|5|6| @3|L|A|T|I|N| |C|A|P|I|T|A|L| |L|E|T@1|E|R| |A| |W|I|T|H| |M|A|C|R|O|N| @8
11+
|ā| @6|a|-| @5|0|1|0|1| @3|0|2|5|7| @3|L|A|T|I|N| |S|M|A|L@1| |L|E|T@1|E|R| |A| |W|I|T|H| |M|A|C|R|O|N| @10
12+
|Ă| @6|A|(| @5|0|1|0|2| @3|0|2|5|8| @3|L|A|T|I|N| |C|A|P|I|T|A|L| |L|E|T@1|E|R| |A| |W|I|T|H| |B|R|E|V|E| @9
13+
|ă| @6|a|(| @5|0|1|0|3| @3|0|2|5|9| @3|L|A|T|I|N| |S|M|A|L@1| |L|E|T@1|E|R| |A| |W|I|T|H| |B|R|E|V|E| @11
14+
|Ą| @6|A|;| @5|0|1|0|4| @3|0|2|6|0| @3|L|A|T|I|N| |C|A|P|I|T|A|L| |L|E|T@1|E|R| |A| |W|I|T|H| |O|G|O|N|E|K| @8
15+
|ą| @6|a|;| @5|0|1|0|5| @3|0|2|6|1| @3|L|A|T|I|N| |S|M|A|L@1| |L|E|T@1|E|R| |A| |W|I|T|H| |O|G|O|N|E|K| @10
16+
|Ć| @6|C|'| @5|0|1|0|6| @3|0|2|6|2| @3|L|A|T|I|N| |C|A|P|I|T|A|L| |L|E|T@1|E|R| |C| |W|I|T|H| |A|C|U|T|E| @9
17+
|ć| @6|c|'| @5|0|1|0|7| @3|0|2|6|3| @3|L|A|T|I|N| |S|M|A|L@1| |L|E|T@1|E|R| |C| |W|I|T|H| |A|C|U|T|E| @11
18+
|Ĉ| @6|C|>| @5|0|1|0|8| @3|0|2|6|4| @3|L|A|T|I|N| |C|A|P|I|T|A|L| |L|E|T@1|E|R| |C| |W|I|T|H| |C|I|R|C|U|M|F|L|E|X| @4
19+
|ĉ| @6|c|>| @5|0|1|0|9| @3|0|2|6|5| @3|L|A|T|I|N| |S|M|A|L@1| |L|E|T@1|E|R| |C| |W|I|T|H| |C|I|R|C|U|M|F|L|E|X| @6
20+
@57|1|8|,|0|-|1| @7|8|6|%|
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
|ĉ+0&#ffffff0| @6|c|>| @5|0|1|0|9| @3|0|2|6|5| @3|L|A|T|I|N| |S|M|A|L@1| |L|E|T@1|E|R| |C| |W|I|T|H| |C|I|R|C|U|M|F|L|E|X| @6
2+
@75
3+
@1>v|i|m|:|t|w|=|7|8|:|t|s|=|8|:|n|o|e|t|:|f|t|=|h|e|l|p|:|n|o|r|l|:| @40
4+
|~+0#4040ff13&| @73
5+
|~| @73
6+
|~| @73
7+
|~| @73
8+
|~| @73
9+
|~| @73
10+
|~| @73
11+
|~| @73
12+
|~| @73
13+
|~| @73
14+
|~| @73
15+
|~| @73
16+
|~| @73
17+
|~| @73
18+
|~| @73
19+
|~| @73
20+
| +0#0000000&@56|3|2|,|2| @9|B|o|t|

0 commit comments

Comments
 (0)