]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(help): Update help syntax
authorMilly <milly.ca@gmail.com>
Wed, 16 Oct 2024 20:11:17 +0000 (22:11 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 16 Oct 2024 20:11:17 +0000 (22:11 +0200)
This commit makaes the following changes to the vim help syntax:

- fix excessive URL detection in help, because `file:{filename}` in
  doc/options.txt is determined to be a URL.
- update highlighting N for :resize in help
- split Italian-specific syntax into separate help script
- highlight `Note` in parentheses in help
- update 'titlestring' behaviour in documentation for invalid '%' format

closes: #15883

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/builtin.txt
runtime/doc/options.txt
runtime/syntax/help.vim
runtime/syntax/help_it.vim [new file with mode: 0644]

index 32167d67fb8401355c6d7cc41ed722b19f222c6e..5d9a436688f1b545f5f887bf693b05c8b2e3684c 100644 (file)
@@ -1,4 +1,4 @@
-*builtin.txt*  For Vim version 9.1.  Last change: 2024 Oct 14
+*builtin.txt*  For Vim version 9.1.  Last change: 2024 Oct 16
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -11954,7 +11954,7 @@ wildmenumode()                                  *wildmenumode()*
                For example to make <c-j> work like <down> in wildmode, use: >
     :cnoremap <expr> <C-j> wildmenumode() ? "\<Down>\<Tab>" : "\<c-j>"
 <
-               (Note, this needs the 'wildcharm' option set appropriately).
+               (Note: this needs the 'wildcharm' option set appropriately).
 
                Return type: |Number|
 
index 40dc139b0876d760f046f839451bc95196d96bc3..075d3ee5eb4b923d6e40c09156e3c2ae56ef7249 100644 (file)
@@ -1,4 +1,4 @@
-*options.txt*  For Vim version 9.1.  Last change: 2024 Oct 14
+*options.txt*  For Vim version 9.1.  Last change: 2024 Oct 16
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -8705,7 +8705,9 @@ A jump table for the options with a short description can be found at |Q_op|.
        be restored if possible, see |X11|.
 
        When this option contains printf-style '%' items, they will be
-       expanded according to the rules used for 'statusline'.
+       expanded according to the rules used for 'statusline'.  If it contains
+       an invalid '%' format, the value is used as-is and no error or warning
+       will be given when the value is set.
        This option cannot be set in a modeline when 'modelineexpr' is off.
 
        Example: >
index 68f68c29604e6b20989ca34a4e3aad5c8b25694e..ae7e3bc6a7c08629d6a4077317aecf4d6b94ddd8 100644 (file)
@@ -57,6 +57,7 @@ else
   syn match helpIgnore         "." contained
 endif
 syn keyword helpNote           note Note NOTE note: Note: NOTE: Notes Notes:
+syn match helpNote             "\c(note\(:\|\>\)"ms=s+1
 syn keyword helpWarning                WARNING WARNING: Warning:
 syn keyword helpDeprecated     DEPRECATED DEPRECATED: Deprecated:
 syn match helpSpecial          "\<N\>"
@@ -69,6 +70,10 @@ syn match helpSpecial                "\[N]"
 syn match helpSpecial          "N  N"he=s+1
 syn match helpSpecial          "Nth"me=e-2
 syn match helpSpecial          "N-1"me=e-2
+" highlighting N for :resize in windows.txt
+syn match helpSpecial          "] -N\>"ms=s+3
+syn match helpSpecial          "+N\>"ms=s+1
+syn match helpSpecial          "\[+-]N\>"ms=s+4
 " highlighting N of cinoptions-values in indent.txt
 syn match helpSpecial          "^\t-\?\zsNs\?\s"me=s+1
 " highlighting N of cinoptions-values in indent.txt
@@ -145,7 +150,7 @@ syn match helpUnderlined    "\t[* ]Underlined\t\+[a-z].*"
 syn match helpError            "\t[* ]Error\t\+[a-z].*"
 syn match helpTodo             "\t[* ]Todo\t\+[a-z].*"
 
-syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^'         <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^'        <>"]+)[a-zA-Z0-9/]`
+syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^'" \t<>{}]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^'" \t<>{}]+)[a-zA-Z0-9/]`
 
 syn match helpDiffAdded                "\t[* ]Added\t\+[a-z].*"
 syn match helpDiffChanged      "\t[* ]Changed\t\+[a-z].*"
@@ -157,17 +162,6 @@ if s:i > 0
   exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim"
 endif
 
-" Italian
-if v:lang =~ '\<IT\>' || v:lang =~ '_IT\>' || v:lang =~? "italian"
-  syn keyword helpNote         nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE:
-  syn match helpSpecial                "Nma"me=e-2
-  syn match helpSpecial                "Nme"me=e-2
-  syn match helpSpecial                "Nmi"me=e-2
-  syn match helpSpecial                "Nmo"me=e-2
-  syn match helpSpecial                "\[interv.]"
-  syn region helpNotVi         start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump
-endif
-
 syn sync minlines=40
 
 
diff --git a/runtime/syntax/help_it.vim b/runtime/syntax/help_it.vim
new file mode 100644 (file)
index 0000000..e76851d
--- /dev/null
@@ -0,0 +1,17 @@
+" Vim syntax file
+" Language:    Italian Vim program help files *.itx
+" Maintainer:  The Vim Project <https://github.com/vim/vim>
+" Last Change: 2024 Oct 16
+"
+" This script is sourced from syntax/help.vim.
+
+syn keyword helpNote           nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE:
+syn match helpNote             "\c(nota\(:\|\>\)"ms=s+1
+syn match helpSpecial          "Nma"me=e-2
+syn match helpSpecial          "Nme"me=e-2
+syn match helpSpecial          "Nmi"me=e-2
+syn match helpSpecial          "Nmo"me=e-2
+syn match helpSpecial          "\[interv.]"
+syn region helpNotVi           start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump
+
+" vim: ts=8 sw=2