marshallward / vim-restructuredtext

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

Fix Doctest recognition #69

Closed ghost closed 2 years ago

ghost commented 3 years ago

Doctest blocks were not correctly highlighted. This can be checked with the test document in the first commit.

The culprit seemed to be the "oneline" argument to the docblock match, which is not applicable as docblocks span multiple lines. I do not fully understands vim syntax but I believe "display" might also applicable. Vim's documentation lists sufficient conditions which all do not match anymore. You probably understand much more, so add it back if you think you can.

The last commit also highlights subsequent '>>>' contained inside the same doctest block. This is not strictly necessary, nor a special part of ReST but in my opinion makes sense. Feel free to omit this one.

marshallward commented 2 years ago

I'm not sure why I sat on this one for so long, it looks very straightforward. Sorry for the very long delay in merging this.