mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
vim-patch:6c2fc37: 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: vim/vim#15883
6c2fc377bf
Co-authored-by: Milly <milly.ca@gmail.com>
This commit is contained in:
parent
de74ed35af
commit
c89150241d
2
runtime/doc/builtin.txt
generated
2
runtime/doc/builtin.txt
generated
@ -11705,7 +11705,7 @@ wildmenumode() *wildmenumode()*
|
||||
For example to make <c-j> work like <down> in wildmode, use: >vim
|
||||
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: ~
|
||||
(`any`)
|
||||
|
@ -6763,7 +6763,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
window. This happens only when the 'title' option is on.
|
||||
|
||||
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: >vim
|
||||
|
4
runtime/lua/vim/_meta/options.lua
generated
4
runtime/lua/vim/_meta/options.lua
generated
@ -7310,7 +7310,9 @@ vim.go.titleold = vim.o.titleold
|
||||
--- window. This happens only when the 'title' option is on.
|
||||
---
|
||||
--- 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:
|
||||
|
2
runtime/lua/vim/_meta/vimfn.lua
generated
2
runtime/lua/vim/_meta/vimfn.lua
generated
@ -10629,7 +10629,7 @@ function vim.fn.wait(timeout, condition, interval) end
|
||||
--- For example to make <c-j> work like <down> in wildmode, use: >vim
|
||||
--- 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 any
|
||||
function vim.fn.wildmenumode() end
|
||||
|
@ -53,6 +53,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\>"
|
||||
@ -65,6 +66,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
|
||||
@ -140,7 +145,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].*"
|
||||
@ -152,16 +157,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.]"
|
||||
endif
|
||||
|
||||
syn sync minlines=40
|
||||
|
||||
|
||||
|
17
runtime/syntax/help_it.vim
Normal file
17
runtime/syntax/help_it.vim
Normal file
@ -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
|
@ -12768,7 +12768,7 @@ M.funcs = {
|
||||
For example to make <c-j> work like <down> in wildmode, use: >vim
|
||||
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).
|
||||
]=],
|
||||
name = 'wildmenumode',
|
||||
params = {},
|
||||
|
@ -9130,7 +9130,9 @@ return {
|
||||
window. This happens only when the 'title' option is on.
|
||||
|
||||
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: >vim
|
||||
|
Loading…
Reference in New Issue
Block a user