summaryrefslogtreecommitdiffstats
path: root/syntax/rst.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2019-07-01 16:25:37 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2019-07-01 16:25:37 +0200
commit140430ffb73d5e0851ba2df2abd29106b1677687 (patch)
tree686fc28a75cbcdddbfad4a2e93f0433614d182bc /syntax/rst.vim
parentd52700284984ada048ce325404dfa25237271ba1 (diff)
downloadvim-polyglot-140430ffb73d5e0851ba2df2abd29106b1677687.tar.gz
vim-polyglot-140430ffb73d5e0851ba2df2abd29106b1677687.zip
Update
Diffstat (limited to 'syntax/rst.vim')
-rw-r--r--syntax/rst.vim11
1 files changed, 9 insertions, 2 deletions
diff --git a/syntax/rst.vim b/syntax/rst.vim
index a875a44b..43b17aa8 100644
--- a/syntax/rst.vim
+++ b/syntax/rst.vim
@@ -94,7 +94,14 @@ execute 'syn match rstSubstitutionDefinition contained' .
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right)
- execute 'syn match rstEscape'.a:name.' +\\\\\|\\'.a:start.'+'.' contained'
+ " 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 .
@@ -170,7 +177,7 @@ syn match rstStandaloneHyperlink contains=@NoSpell
\ "\<\%(\%(\%(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*\n\%(\s*:.*:\s*.*\s*\n\)*\n\ze\z(\s\+\)+
\ skip=+^$+
\ end=+^\z1\@!+
\ contains=@NoSpell