Skip to content

Commit 46d8697

Browse files
marshallwardchrisbra
authored andcommitted
runtime(rst): Style update
Minor style and whitespace changes to the reST syntax file, to sync with the development branch. related: #18566 Signed-off-by: Marshall Ward <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent a70f346 commit 46d8697

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

runtime/syntax/rst.vim

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
" Language: reStructuredText documentation format
33
" Maintainer: Marshall Ward <[email protected]>
44
" Previous Maintainer: Nikolai Weibull <[email protected]>
5+
" Reference: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html
56
" Website: https://github.com/marshallward/vim-restructuredtext
6-
" Latest Revision: 2020-03-31
7+
" Latest Revision: 2025-10-13
78

89
if exists("b:current_syntax")
910
finish
@@ -12,7 +13,8 @@ endif
1213
let s:cpo_save = &cpo
1314
set cpo&vim
1415

15-
syn case ignore
16+
" reStructuredText is case-insensitive
17+
syntax case ignore
1618

1719
syn match rstTransition /^[=`:.'"~^_*+#-]\{4,}\s*$/
1820

@@ -97,6 +99,9 @@ execute 'syn region rstExDirective contained matchgroup=rstDirective' .
9799
execute 'syn match rstSubstitutionDefinition contained' .
98100
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
99101

102+
103+
"" Inline Markup ""
104+
100105
function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right)
101106
" Only escape the first char of a multichar delimiter (e.g. \* inside **)
102107
if a:start[0] == '\'
@@ -190,6 +195,8 @@ execute 'syn match rstHyperlinkReference' .
190195
syn match rstStandaloneHyperlink contains=@NoSpell
191196
\ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
192197

198+
" `code` is the standard reST directive for source code.
199+
" `code-block` and `sourcecode` are nearly identical directives in Sphinx.
193200
syn region rstCodeBlock contained matchgroup=rstDirective
194201
\ start=+\%(sourcecode\|code\%(-block\)\=\)::\s*\(\S*\)\?\s*\n\%(\s*:.*:\s*.*\s*\n\)*\n\ze\z(\s\+\)+
195202
\ skip=+^$+

0 commit comments

Comments
 (0)