2690

Textmateで全角を見分けるのコード部分だけ


TextMateで全角スペースと半角スペースの区別ができるようにする : アシアルブログ」の手順3〜4を施したコードのメモです。

注意

コード

{   scopeName = 'text.html.basic';
    firstLineMatch = '
        |)$
        |(?:php)?.*b(if|for(each)?|while)b.+:
        |{{?(if|foreach|capture|literal|foreach|php|section|strip)
        |{s*($|?>s*$|//|/*(.**/s*$|(?!.*?*/)))
        )';
    foldingStopMarker = '(?x)
        ((?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)>
        |^(?!.*?$
        |(?:php)?.*bend(if|for(each)?|while)b
        |{{?/(if|foreach|capture|literal|foreach|php|section|strip)
        |^[^{]*}
        )';
    patterns = (
        { include = '#whitespace-multi'; },
        {   name = 'meta.tag.any.html';
            begin = '(]*>2>)';
            end = '(>()';
            beginCaptures = {
                1 = { name = 'punctuation.definition.tag.html'; };
                2 = { name = 'entity.name.tag.html'; };
            };
            endCaptures = {
                1 = { name = 'punctuation.definition.tag.html'; };
                2 = { name = 'meta.scope.between-tag-pair.html'; };
                3 = { name = 'entity.name.tag.html'; };
                4 = { name = 'punctuation.definition.tag.html'; };
            };
            patterns = ( { include = '#tag-stuff'; } );
        },
        {   name = 'meta.tag.preprocessor.xml.html';
            begin = '()(xml)';
            end = '(?>)';
            captures = {
                1 = { name = 'punctuation.definition.tag.html'; };
                2 = { name = 'entity.name.tag.xml.html'; };
            };
            patterns = (
                {   include = '#tag-generic-attribute'; },
                {   include = '#string-double-quoted'; },
                {   include = '#string-single-quoted'; },
            );
        },
        {   name = 'comment.block.html';
            begin = '