This commit is contained in:
Adam Stankiewicz
2019-06-08 12:44:15 +02:00
parent aebef2c2e7
commit 671078ef6c
27 changed files with 862 additions and 7758 deletions

View File

@@ -94,16 +94,21 @@ 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'
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, "'", "'")