mirror of
https://github.com/neovim/neovim.git
synced 2025-10-18 15:51:50 +00:00
vim-patch:46d8697: runtime(rst): Style update
Minor style and whitespace changes to the reST syntax file, to sync with
the development branch.
related: vim/vim#18566
46d86979a9
Co-authored-by: Marshall Ward <marshall.ward@gmail.com>
This commit is contained in:
@@ -2,8 +2,9 @@
|
|||||||
" Language: reStructuredText documentation format
|
" Language: reStructuredText documentation format
|
||||||
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
|
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
|
||||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||||
|
" Reference: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html
|
||||||
" Website: https://github.com/marshallward/vim-restructuredtext
|
" Website: https://github.com/marshallward/vim-restructuredtext
|
||||||
" Latest Revision: 2020-03-31
|
" Latest Revision: 2025-10-13
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
@@ -12,7 +13,8 @@ endif
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
syn case ignore
|
" reStructuredText is case-insensitive
|
||||||
|
syntax case ignore
|
||||||
|
|
||||||
syn match rstTransition /^[=`:.'"~^_*+#-]\{4,}\s*$/
|
syn match rstTransition /^[=`:.'"~^_*+#-]\{4,}\s*$/
|
||||||
|
|
||||||
@@ -97,6 +99,9 @@ execute 'syn region rstExDirective contained matchgroup=rstDirective' .
|
|||||||
execute 'syn match rstSubstitutionDefinition contained' .
|
execute 'syn match rstSubstitutionDefinition contained' .
|
||||||
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
|
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
|
||||||
|
|
||||||
|
|
||||||
|
"" Inline Markup ""
|
||||||
|
|
||||||
function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right)
|
function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right)
|
||||||
" Only escape the first char of a multichar delimiter (e.g. \* inside **)
|
" Only escape the first char of a multichar delimiter (e.g. \* inside **)
|
||||||
if a:start[0] == '\'
|
if a:start[0] == '\'
|
||||||
@@ -190,6 +195,8 @@ execute 'syn match rstHyperlinkReference' .
|
|||||||
syn match rstStandaloneHyperlink contains=@NoSpell
|
syn match rstStandaloneHyperlink contains=@NoSpell
|
||||||
\ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
|
\ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
|
||||||
|
|
||||||
|
" `code` is the standard reST directive for source code.
|
||||||
|
" `code-block` and `sourcecode` are nearly identical directives in Sphinx.
|
||||||
syn region rstCodeBlock contained matchgroup=rstDirective
|
syn region rstCodeBlock contained matchgroup=rstDirective
|
||||||
\ start=+\%(sourcecode\|code\%(-block\)\=\)::\s*\(\S*\)\?\s*\n\%(\s*:.*:\s*.*\s*\n\)*\n\ze\z(\s\+\)+
|
\ start=+\%(sourcecode\|code\%(-block\)\=\)::\s*\(\S*\)\?\s*\n\%(\s*:.*:\s*.*\s*\n\)*\n\ze\z(\s\+\)+
|
||||||
\ skip=+^$+
|
\ skip=+^$+
|
||||||
|
Reference in New Issue
Block a user