Skip to content

Commit 6c2fc37

Browse files
Millychrisbra
authored andcommitted
runtime(help): Update help syntax
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>
1 parent 4bfb899 commit 6c2fc37

4 files changed

Lines changed: 29 additions & 16 deletions

File tree

runtime/doc/builtin.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.1. Last change: 2024 Oct 14
1+
*builtin.txt* For Vim version 9.1. Last change: 2024 Oct 16
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -11954,7 +11954,7 @@ wildmenumode() *wildmenumode()*
1195411954
For example to make <c-j> work like <down> in wildmode, use: >
1195511955
:cnoremap <expr> <C-j> wildmenumode() ? "\<Down>\<Tab>" : "\<c-j>"
1195611956
<
11957-
(Note, this needs the 'wildcharm' option set appropriately).
11957+
(Note: this needs the 'wildcharm' option set appropriately).
1195811958

1195911959
Return type: |Number|
1196011960

runtime/doc/options.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 9.1. Last change: 2024 Oct 14
1+
*options.txt* For Vim version 9.1. Last change: 2024 Oct 16
22

33

44
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|.
87058705
be restored if possible, see |X11|.
87068706

87078707
When this option contains printf-style '%' items, they will be
8708-
expanded according to the rules used for 'statusline'.
8708+
expanded according to the rules used for 'statusline'. If it contains
8709+
an invalid '%' format, the value is used as-is and no error or warning
8710+
will be given when the value is set.
87098711
This option cannot be set in a modeline when 'modelineexpr' is off.
87108712

87118713
Example: >

runtime/syntax/help.vim

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ else
5757
syn match helpIgnore "." contained
5858
endif
5959
syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes:
60+
syn match helpNote "\c(note\(:\|\>\)"ms=s+1
6061
syn keyword helpWarning WARNING WARNING: Warning:
6162
syn keyword helpDeprecated DEPRECATED DEPRECATED: Deprecated:
6263
syn match helpSpecial "\<N\>"
@@ -69,6 +70,10 @@ syn match helpSpecial "\[N]"
6970
syn match helpSpecial "N N"he=s+1
7071
syn match helpSpecial "Nth"me=e-2
7172
syn match helpSpecial "N-1"me=e-2
73+
" highlighting N for :resize in windows.txt
74+
syn match helpSpecial "] -N\>"ms=s+3
75+
syn match helpSpecial "+N\>"ms=s+1
76+
syn match helpSpecial "\[+-]N\>"ms=s+4
7277
" highlighting N of cinoptions-values in indent.txt
7378
syn match helpSpecial "^\t-\?\zsNs\?\s"me=s+1
7479
" highlighting N of cinoptions-values in indent.txt
@@ -145,7 +150,7 @@ syn match helpUnderlined "\t[* ]Underlined\t\+[a-z].*"
145150
syn match helpError "\t[* ]Error\t\+[a-z].*"
146151
syn match helpTodo "\t[* ]Todo\t\+[a-z].*"
147152

148-
syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-zA-Z0-9/]`
153+
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/]`
149154

150155
syn match helpDiffAdded "\t[* ]Added\t\+[a-z].*"
151156
syn match helpDiffChanged "\t[* ]Changed\t\+[a-z].*"
@@ -157,17 +162,6 @@ if s:i > 0
157162
exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim"
158163
endif
159164

160-
" Italian
161-
if v:lang =~ '\<IT\>' || v:lang =~ '_IT\>' || v:lang =~? "italian"
162-
syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE:
163-
syn match helpSpecial "Nma"me=e-2
164-
syn match helpSpecial "Nme"me=e-2
165-
syn match helpSpecial "Nmi"me=e-2
166-
syn match helpSpecial "Nmo"me=e-2
167-
syn match helpSpecial "\[interv.]"
168-
syn region helpNotVi start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump
169-
endif
170-
171165
syn sync minlines=40
172166

173167

runtime/syntax/help_it.vim

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
" Vim syntax file
2+
" Language: Italian Vim program help files *.itx
3+
" Maintainer: The Vim Project <https://github.com/vim/vim>
4+
" Last Change: 2024 Oct 16
5+
"
6+
" This script is sourced from syntax/help.vim.
7+
8+
syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE:
9+
syn match helpNote "\c(nota\(:\|\>\)"ms=s+1
10+
syn match helpSpecial "Nma"me=e-2
11+
syn match helpSpecial "Nme"me=e-2
12+
syn match helpSpecial "Nmi"me=e-2
13+
syn match helpSpecial "Nmo"me=e-2
14+
syn match helpSpecial "\[interv.]"
15+
syn region helpNotVi start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump
16+
17+
" vim: ts=8 sw=2

0 commit comments

Comments
 (0)