diff --git a/syntaxes/rst.tmLanguage.json b/syntaxes/rst.tmLanguage.json index be6d4ed..b1fee99 100644 --- a/syntaxes/rst.tmLanguage.json +++ b/syntaxes/rst.tmLanguage.json @@ -234,7 +234,7 @@ }, "block": { "begin": "^(\\s*)(\\.{2}\\s+\\S+::)(.*)", - "while": "^\\1(?=\\s)|^\\s*$", + "end": "^(?!\\1\\s|\\s*$)", "beginCaptures": { "2": { "name": "keyword.control" diff --git a/syntaxes/test/_nested-blocks.rst b/syntaxes/test/_nested-blocks.rst new file mode 100644 index 0000000..425ad31 --- /dev/null +++ b/syntaxes/test/_nested-blocks.rst @@ -0,0 +1,25 @@ +-- SYNTAX TEST "source.rst" "nested blocks" + +:param: abc +-- <----- -keyword.control + +.. note:: aa +-- <--------- keyword.control + + :param: abc +--^^^^^^^ keyword.control + + .. note:: b +--^^^^^^^^^ keyword.control + + .. note:: c +-- ^^^^^^^^^ keyword.control + + .. comment c +-- ^^^^^^^^^^^^ comment.block + + .. comment b +--^^^^^^^^^^^^ comment.block + +.. comment a +-- <------------ comment.block