From 8644c3b7e651ac1d68637e6277af2adeeffbe6f2 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 13 Nov 2025 20:59:44 +0000 Subject: [PATCH] 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 Signed-off-by: Christian Brabandt --- runtime/syntax/help.vim | 37 +++++++++++-------- .../testdir/dumps/help_digraph_table_00.dump | 20 ++++++++++ .../testdir/dumps/help_digraph_table_01.dump | 20 ++++++++++ .../testdir/dumps/help_digraph_table_02.dump | 20 ++++++++++ 4 files changed, 81 insertions(+), 16 deletions(-) create mode 100644 runtime/syntax/testdir/dumps/help_digraph_table_00.dump create mode 100644 runtime/syntax/testdir/dumps/help_digraph_table_01.dump create mode 100644 runtime/syntax/testdir/dumps/help_digraph_table_02.dump diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim index 6bae1fb0be..effdc4b874 100644 --- a/runtime/syntax/help.vim +++ b/runtime/syntax/help.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Vim help file " Maintainer: Doug Kearns -" Last Change: 2025 Oct 19 +" Last Change: 2025 Nov 13 " Former Maintainer: Bram Moolenaar " 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 "\\\@ 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 diff --git a/runtime/syntax/testdir/dumps/help_digraph_table_00.dump b/runtime/syntax/testdir/dumps/help_digraph_table_00.dump new file mode 100644 index 0000000000..b548f33629 --- /dev/null +++ b/runtime/syntax/testdir/dumps/help_digraph_table_00.dump @@ -0,0 +1,20 @@ +> +0&#ffffff0@74 +@56|*+0#ffffff16&|d+0#e000002&|i|g|r|a|p|h|-|t|a|b|l|e|*+0#ffffff16&| +0#0000000&@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 +|^|@| @5|N|U| @5|0|x|0@1| @5|0| @4|N|U|L@1| |(|N|U|L|)| @32 +|^|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 +|^|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 +|^|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 +|^|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 +|^|E| @5|E|Q| @5|0|x|0|5| @5|5| @4|E|N|Q|U|I|R|Y| |(|E|N|Q|)| @29 +|^|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 +|^|G| @5|B|L| @5|0|x|0|7| @5|7| @4|B|E|L@1| |(|B|E|L|)| @32 +|^|H| @5|B|S| @5|0|x|0|8| @5|8| @4|B|A|C|K|S|P|A|C|E| |(|B|S|)| @28 +|^|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 +|Ñ| @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 +@75 +|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 +|f| @73 +|a|d@1|i|t|i|o|n|a|l| |d|i|g|r|a|p|h|s|:| @54 +@75 +@57|1|,|0|-|1| @8|T|o|p| diff --git a/runtime/syntax/testdir/dumps/help_digraph_table_01.dump b/runtime/syntax/testdir/dumps/help_digraph_table_01.dump new file mode 100644 index 0000000000..8a08cfdad8 --- /dev/null +++ b/runtime/syntax/testdir/dumps/help_digraph_table_01.dump @@ -0,0 +1,20 @@ +|Ñ+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 +@75 +|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 +|f| @73 +|a|d@1|i|t|i|o|n|a|l| |d|i|g|r|a|p|h|s|:| @54 +> @74 +@56|*+0#ffffff16&|d+0#e000002&|i|g|r|a|p|h|-|t|a|b|l|e|-|m|b|y|t +|e|*+0#ffffff16&| +0#0000000&@72 +|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 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@6 +@57|1|8|,|0|-|1| @7|8|6|%| diff --git a/runtime/syntax/testdir/dumps/help_digraph_table_02.dump b/runtime/syntax/testdir/dumps/help_digraph_table_02.dump new file mode 100644 index 0000000000..de4a996c61 --- /dev/null +++ b/runtime/syntax/testdir/dumps/help_digraph_table_02.dump @@ -0,0 +1,20 @@ +|ĉ+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 +@75 +@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 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|3|2|,|2| @9|B|o|t|