]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(help): Update syntax, match legacy header at :help vim9-mix
authorDoug Kearns <dougkearns@gmail.com>
Tue, 30 Sep 2025 20:12:55 +0000 (20:12 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 30 Sep 2025 20:12:55 +0000 (20:12 +0000)
closes: #18458

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/vim9.txt
runtime/syntax/help.vim
runtime/syntax/testdir/dumps/help_01.dump
runtime/syntax/testdir/dumps/help_02.dump
runtime/syntax/testdir/dumps/help_03.dump [new file with mode: 0644]
runtime/syntax/testdir/input/help.txt

index 3de4a75e9bd79edfa6ed43a657f77b6dfffd03cb..70c8cdb32db997e9e4acc974857f133d55243abb 100644 (file)
@@ -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.
 
index 35b4572bfaaf32de69e29098a47aba147484a04f..2d07b7018f484139cc6e6e1eb31da27025da8ec4 100644 (file)
@@ -1,7 +1,7 @@
 " Vim syntax file
 " Language:            Vim help file
 " Maintainer:          Doug Kearns <dougkearns@gmail.com>
-" Last Change:         2025 Sep 27
+" Last Change:         2025 Sep 29
 " Former Maintainer:   Bram Moolenaar <Bram@vim.org>
 
 " 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
index dbfd8daaf78efe8d1dc6227bf774828a78cf388c..b505335f6b596165e28a21568196a0ac795a87de 100644 (file)
@@ -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|%| 
index 9124337006601e5543dc40d6ba4b3ab5e0ead2b7..1bd0813896bbd063c8f50042d975740b1af15a7a 100644 (file)
@@ -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 (file)
index 0000000..f403f1c
--- /dev/null
@@ -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| 
index 37f34a9340c20265d092f1e8deab304dea2b9ff6..fd56f9cd0dbfc17b02cb1119b9ad29cfb6eb1d05 100644 (file)
@@ -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: