runtime(help): Update syntax, match legacy header at :help vim9-mix

Commit: 
https://github.com/vim/vim/commit/21d40d2d41f3f0d6463f48118f7924ac8ed7852e
Author: Doug Kearns <[email protected]>
Date:   Tue Sep 30 20:12:55 2025 +0000

    runtime(help): Update syntax, match legacy header at :help vim9-mix
    
    closes: https://github.com/vim/vim/issues/18458
    
    Signed-off-by: Doug Kearns <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index 3de4a75e9..70c8cdb32 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -1,4 +1,4 @@
-*vim9.txt*     For Vim version 9.1.  Last change: 2025 Aug 27
+*vim9.txt*     For Vim version 9.1.  Last change: 2025 Sep 30
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -2083,14 +2083,16 @@ original value to get the same effect.  The order of 
flags may change.
 In the |vimrc| file sourced on startup this does not happen.
 
                                                        *vim9-mix*
-There is one way to use both legacy and Vim9 syntax in one script file: >
-       " comments may go here
+There is one way to use both legacy and Vim9 syntax in one script file: >vim9
+
+       " legacy Vim script comments may go here
        if !has('vim9script')
-          " legacy script commands go here
+          " legacy Vim script commands go here
           finish
        endif
        vim9script
        # Vim9 script commands go here
+
 This allows for writing a script that takes advantage of the Vim9 script
 syntax if possible, but will also work on a Vim version without it.
 
diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim
index 35b4572bf..2d07b7018 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 <[email protected]>
-" Last Change:         2025 Sep 27
+" Last Change:         2025 Sep 29
 " Former Maintainer:   Bram Moolenaar <[email protected]>
 
 " Quit when a (custom) syntax file was already loaded
@@ -53,6 +53,15 @@ for [s:lang, s:syntax] in g:help_example_languages->items()
 endfor
 unlet! s:lang s:syntax
 
+if has_key(g:help_example_languages, "vim9")
+  " for example at :help vim9-mix
+  syn region vim9LegacyHeader_HelpExample
+       \ start=+" legacy Vim script comments may go here+
+       \ end="^\ze\s*vim9s\%[cript]\>"
+       \ contains=@vimLegacyTop,vimComment,vimLineComment
+  syn cluster helpExampleHighlight_vim9 add=vim9LegacyHeader_HelpExample
+endif
+
 if has("ebcdic")
   syn match helpHyperTextJump  "\\@<!|[^"*|]\+|" contains=helpBar
   syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1 contains=helpStar
diff --git a/runtime/syntax/testdir/dumps/help_01.dump 
b/runtime/syntax/testdir/dumps/help_01.dump
index dbfd8daaf..b505335f6 100644
--- a/runtime/syntax/testdir/dumps/help_01.dump
+++ b/runtime/syntax/testdir/dumps/help_01.dump
@@ -17,4 +17,4 @@
 |h|o|w|e|v|e|r|,| |t|h|a|t| |a|n|y| |l|o|n|g| |d|i|r|e|c|t|o|r|y| |n|a|m|e|s| 
|w|i|l@1| |a|p@1|e|a|r| |i|n| |t|h|e|i|r| |s|h|o|r|t| |(|M|S|-|D|O|S|)| 
 |f|o|r|m| |o|n| |s|o|m|e| |W|i|n|d|o|w|s| |v|e|r|s|i|o|n|s|.| @1|T|h|i|s| 
|i|s| |a| |l|i|m|i|t|a|t|i|o|n| |o|f| |t|h|e| |W|i|n|d|o|w|s| |"|S|e|n|d| |T
 |o|"| @72
-@57|1|9|,|1| @9|8|1|%| 
+@57|1|9|,|1| @9|4|0|%| 
diff --git a/runtime/syntax/testdir/dumps/help_02.dump 
b/runtime/syntax/testdir/dumps/help_02.dump
index 912433700..1bd081389 100644
--- a/runtime/syntax/testdir/dumps/help_02.dump
+++ b/runtime/syntax/testdir/dumps/help_02.dump
@@ -2,19 +2,19 @@
 |o|"| @72
 |m|e|c|h|a|n|i|s|m|.| @64
 @75
->v|i|m|:| |s|e|t| |f|t|=|h|e|l|p|:| @57
-|~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-| +0#0000000&@56|3@1|,|1| @9|B|o|t| 
+@75
+>E+0#e000e06&|X|A|M|P|L|E| |L|A|N|G|U|A|G|E|S|~+0#ffffff16&| +0#0000000&@56
+@56|*+0#ffffff16&|v+0#e000002&|i|m|9|-|m|i|x|*+0#ffffff16&| +0#0000000&@8
+|T|h|e|r|e| |i|s| |o|n|e| |w|a|y| |t|o| |u|s|e| |b|o|t|h| |l|e|g|a|c|y| 
|a|n|d| |V|i|m|9| |s|y|n|t|a|x| |i|n| |o|n|e| |s|c|r|i|p|t| |f|i|l|e|:| 
+0#ffffff16&|>|v|i
+|m|9| +0#0000000&@72
+@75
+@8|"+0#0000e05&| |l|e|g|a|c|y| |V|i|m| |s|c|r|i|p|t| |c|o|m@1|e|n|t|s| |m|a|y| 
|g|o| |h|e|r|e| +0#0000000&@26
+@8|i+0#af5f00255&|f| 
+0#0000000&|!+0#af5f00255&|h+0#00e0e07&|a|s|(+0#e000e06&|'+0#e000002&|v|i|m|9|s|c|r|i|p|t|'|)+0#e000e06&|
 +0#0000000&@45
+@11|"+0#0000e05&| |l|e|g|a|c|y| |V|i|m| |s|c|r|i|p|t| |c|o|m@1|a|n|d|s| |g|o| 
|h|e|r|e| +0#0000000&@27
+@11|f+0#af5f00255&|i|n|i|s|h| +0#0000000&@57
+@8|e+0#af5f00255&|n|d|i|f| +0#0000000&@61
+@8|v+0#af5f00255&|i|m|9|s|c|r|i|p|t| +0#0000000&@56
+@8|#+0#0000e05&| |V|i|m|9| |s|c|r|i|p|t| |c|o|m@1|a|n|d|s| |g|o| |h|e|r|e| 
+0#0000000&@36
+@75
+|T|h|i|s| |a|l@1|o|w|s| |f|o|r| |w|r|i|t|i|n|g| |a| |s|c|r|i|p|t| |t|h|a|t| 
|t|a|k|e|s| |a|d|v|a|n|t|a|g|e| |o|f| |t|h|e| |V|i|m|9| |s|c|r|i|p|t| @2
+@57|3|4|,|1| @9|9|0|%| 
diff --git a/runtime/syntax/testdir/dumps/help_03.dump 
b/runtime/syntax/testdir/dumps/help_03.dump
new file mode 100644
index 000000000..f403f1ceb
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/help_03.dump
@@ -0,0 +1,20 @@
+|T+0&#ffffff0|h|i|s| |a|l@1|o|w|s| |f|o|r| |w|r|i|t|i|n|g| |a| |s|c|r|i|p|t| 
|t|h|a|t| |t|a|k|e|s| |a|d|v|a|n|t|a|g|e| |o|f| |t|h|e| |V|i|m|9| |s|c|r|i|p|t| 
@2
+|s|y|n|t|a|x| |i|f| |p|o|s@1|i|b|l|e|,| |b|u|t| |w|i|l@1| |a|l|s|o| |w|o|r|k| 
|o|n| |a| |V|i|m| |v|e|r|s|i|o|n| |w|i|t|h|o|u|t| |i|t|.| @7
+@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
+| +0#0000000&@56|4|9|,|2| @9|B|o|t| 
diff --git a/runtime/syntax/testdir/input/help.txt 
b/runtime/syntax/testdir/input/help.txt
index 37f34a934..fd56f9cd0 100644
--- a/runtime/syntax/testdir/input/help.txt
+++ b/runtime/syntax/testdir/input/help.txt
@@ -30,4 +30,20 @@ however, that any long directory names will appear in their 
short (MS-DOS)
 form on some Windows versions.  This is a limitation of the Windows "Send To"
 mechanism.
 
-vim: set ft=help:
+
+EXAMPLE LANGUAGES~
+                                                       *vim9-mix*
+There is one way to use both legacy and Vim9 syntax in one script file: >vim9
+
+       " legacy Vim script comments may go here
+       if !has('vim9script')
+          " legacy Vim script commands go here
+          finish
+       endif
+       vim9script
+       # Vim9 script commands go here
+
+This allows for writing a script that takes advantage of the Vim9 script
+syntax if possible, but will also work on a Vim version without it.
+
+ vim:tw=78:ts=8:noet:ft=help:norl:

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1v3gkk-003rDr-OA%40256bit.org.

Raspunde prin e-mail lui