Update runtime files
diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim
index c865cf6..a90c90b 100644
--- a/runtime/syntax/rst.vim
+++ b/runtime/syntax/rst.vim
@@ -1,9 +1,9 @@
-" Vim syntax file
+" Vim reST syntax file
" Language: reStructuredText documentation format
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Website: https://github.com/marshallward/vim-restructuredtext
-" Latest Revision: 2018-12-29
+" Latest Revision: 2020-03-31
if exists("b:current_syntax")
finish
@@ -21,7 +21,7 @@
\ rstInlineInternalTargets,rstFootnoteReference,rstHyperlinkReference
syn region rstLiteralBlock matchgroup=rstDelimiter
- \ start='::\_s*\n\ze\z(\s\+\)' skip='^$' end='^\z1\@!'
+ \ start='\(^\z(\s*\).*\)\@<=::\n\s*\n' skip='^\s*$' end='^\(\z1\s\+\)\@!'
\ contains=@NoSpell
syn region rstQuotedLiteralBlock matchgroup=rstDelimiter
@@ -90,16 +90,28 @@
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right)
+ " Only escape the first char of a multichar delimiter (e.g. \* inside **)
+ if a:start[0] == '\'
+ let first = a:start[0:1]
+ else
+ let first = a:start[0]
+ endif
+
+ execute 'syn match rstEscape'.a:name.' +\\\\\|\\'.first.'+'.' contained'
+
execute 'syn region rst' . a:name .
\ ' start=+' . a:char_left . '\zs' . a:start .
\ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' .
\ a:middle .
- \ ' end=+\S' . a:end . '\ze\%($\|\s\|[''"’)\]}>/:.,;!?\\-]\)+'
+ \ ' end=+' . a:end . '\ze\%($\|\s\|[''"’)\]}>/:.,;!?\\-]\)+' .
+ \ ' contains=rstEscape' . a:name
+
+ execute 'hi def link rstEscape'.a:name.' Special'
endfunction
function! s:DefineInlineMarkup(name, start, middle, end)
let middle = a:middle != "" ?
- \ (' skip=+\\\\\|\\' . a:middle . '+') :
+ \ (' skip=+\\\\\|\\' . a:middle . '\|\s' . a:middle . '+') :
\ ""
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'")
@@ -161,7 +173,7 @@
\ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
syn region rstCodeBlock contained matchgroup=rstDirective
- \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s\+.*\_s*\n\ze\z(\s\+\)+
+ \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s*\(\S*\)\?\s*\n\%(\s*:.*:\s*.*\s*\n\)*\n\ze\z(\s\+\)+
\ skip=+^$+
\ end=+^\z1\@!+
\ contains=@NoSpell