diff --git a/XML/Fold.tmPreferences b/XML/Fold.tmPreferences new file mode 100644 index 0000000000..8d31a539a5 --- /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 + 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 2bbd86fb0c..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: '[/\?]>'