diff --git a/XML/Fold.tmPreferences b/XML/Fold.tmPreferences new file mode 100644 index 0000000000..20d8460228 --- /dev/null +++ b/XML/Fold.tmPreferences @@ -0,0 +1,108 @@ + + + + scope + text.xml, text.xml.dtd, text.xml.xsl + settings + + indentationFoldingEnabled + + foldScopes + + + + begin + comment.block punctuation.definition.comment.begin + end + comment.block punctuation.definition.comment.end + excludeTrailingNewlines + + + + + begin + punctuation.definition.string.begin + end + punctuation.definition.string.end + excludeTrailingNewlines + + + + + begin + punctuation.section.brackets.begin + end + punctuation.section.brackets.end + excludeTrailingNewlines + + + + + begin + punctuation.section.group.begin + end + punctuation.section.group.end + excludeTrailingNewlines + + + + + begin + meta.tag.sgml.cdata punctuation.definition.tag.begin.content + end + meta.tag.sgml.cdata punctuation.definition.tag + excludeTrailingNewlines + + + + + begin + meta.tag.sgml keyword.declaration + end + meta.tag.sgml punctuation.definition.tag + excludeTrailingNewlines + + + + + begin + meta.tag.preprocessor entity.name.tag + end + meta.tag.preprocessor punctuation.definition.tag + excludeTrailingNewlines + + + + + begin + meta.tag entity.name.tag.localname + end + meta.tag punctuation.definition.tag + excludeTrailingNewlines + + + + + begin + meta.tag punctuation.definition.tag.end.opening + end + meta.tag punctuation.definition.tag.begin.closing + excludeTrailingNewlines + + + + + + diff --git a/XML/XML.sublime-syntax b/XML/XML.sublime-syntax index 4cc315f20b..f36d09917a 100644 --- a/XML/XML.sublime-syntax +++ b/XML/XML.sublime-syntax @@ -156,11 +156,15 @@ contexts: ###[ CDATA ]################################################################## cdata: + # Notes: + # + # `content` sub-scope is used for folding. + # Changing it might cause folding to break! - match: ( - scope: punctuation.definition.tag.end.xml + - match: /> + scope: punctuation.definition.tag.end.self-closing.xml + pop: 1 + - match: '>' + scope: punctuation.definition.tag.end.opening.xml pop: 1 - match: \?> scope: invalid.illegal.bad-tag-end.xml @@ -587,7 +599,7 @@ contexts: end-tag-content: - meta_scope: meta.tag.xml - match: '>' - scope: punctuation.definition.tag.end.xml + scope: punctuation.definition.tag.end.closing.xml pop: 1 - include: tag-end-missing-pop - match: '[/\?]>' diff --git a/XML/syntax_test_xml.xml b/XML/syntax_test_xml.xml index 7b930d9da4..6ef5e56daf 100644 --- a/XML/syntax_test_xml.xml +++ b/XML/syntax_test_xml.xml @@ -740,7 +740,7 @@ ## ^^^^^^^ keyword.declaration.element ## ^ - keyword - variable ## ^^^^^^^^^ variable.other.element -## ^ punctuation.definition.group.begin +## ^ punctuation.section.group.begin ## ^^^^^^^ constant.other.placeholder ## ^ punctuation.separator ## ^^^ meta.string string.unquoted @@ -753,7 +753,7 @@ ## ^^^^^ variable.parameter ## ^ punctuation.terminator.parameter ## ^ punctuation.separator -## ^ punctuation.definition.group.begin +## ^ punctuation.section.group.begin ## ^ punctuation.definition.entity ## ^^^^^ constant.character.entity.named ## ^ punctuation.terminator.entity @@ -765,9 +765,9 @@ ## ^^^ punctuation.definition.entity ## ^^^^^^ constant.character.entity.hexadecimal ## ^ punctuation.terminator.entity -## ^ punctuation.definition.group.end +## ^ punctuation.section.group.end ## ^ keyword.operator -## ^ punctuation.definition.group.end +## ^ punctuation.section.group.end ## ^ keyword.operator ## ^ punctuation.definition.tag.end