marshallward / vim-restructuredtext

Syntax file for reStructuredText on Vim.
26 stars 12 forks source link

doctest blocks #38

Open anntzer opened 5 years ago

anntzer commented 5 years ago

I just discovered that rst has direct support for doctest blocks: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#doctest-blocks

It looks like syntax/rst.vim had at some point some support for them:

syn region  rstDoctestBlock         oneline display matchgroup=rstDelimiter
      \ start='^>>>\s' end='^$'

but that region declaration is clearly wrong (the "oneline" must be removed, as the end marker never matches on the same line as the start marker).

In addition, it would be nice if these (more specifically, the lines starting with >>> or with ...) could be highlighted using python syntax (say, if "python" is in g:rst_syntax_code_list).