Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(twig) Indentation on wrapped lines is doubled #620

Open
OldStarchy opened this issue Sep 20, 2019 · 1 comment
Open

(twig) Indentation on wrapped lines is doubled #620

OldStarchy opened this issue Sep 20, 2019 · 1 comment

Comments

@OldStarchy
Copy link

OldStarchy commented Sep 20, 2019

Example to reproduce on https://prettydiff.com/ (Beautify mode)

Before:

<html>
    <head></head>
    <body>
        <!-- 
            ALL SPACES AND NO TABS
            MAKES JACK A DULL BOY
        -->
        {#
            ALL SPACES AND NO TABS
            MAKES JACK A DULL BOY
        #}
        <p>
            ALL SPACES AND NO TABS
            MAKES JACK A DULL BOY
        </p>
        <div class="rows">
            <!-- 
                ALL SPACES AND NO TABS
                MAKES JACK A DULL BOY
            -->
            {#
                ALL SPACES AND NO TABS
                MAKES JACK A DULL BOY
            #}
            <p>
                ALL SPACES AND NO TABS
                MAKES JACK A DULL BOY
            </p>
            
            {# also note space introduced in the below div #}
            <div class="row date-row"></div>
            {% for person in data.people %}
                <div class="row">
                    <td class="name">{{ person.displayName }}</td>
                </div>
            {% endfor %}
        </div>
    </body>
</html>

After:

<html>
    <head></head>
    <body>
        <!--
            ALL SPACES AND NO TABS
                    MAKES JACK A DULL BOY -->
        {#
            	    ALL SPACES AND NO TABS
                    MAKES JACK A DULL BOY
            	#}
            <p>
        ALL SPACES AND NO TABS
                    MAKES JACK A DULL BOY
        </p>
            <div class="rows"> <!--
                    ALL SPACES AND NO TABS
                                MAKES JACK A DULL BOY -->
            {#
                    	    ALL SPACES AND NO TABS
                            MAKES JACK A DULL BOY
                    	#}
                <p>
            ALL SPACES AND NO TABS
                            MAKES JACK A DULL BOY
            </p>
            {# also note space introduced in the below div #}<div class="row date-row"> </div>
            {% for person in data.people %}
                <div class="row">
                    <td class="name">{{ person.displayName }}</td>
                </div>
            {% endfor %}
        </div>
    </body>
</html>

Formatting the output repetedly pushes the wrapped lines further and further right. Having combined with the format on save options, they run away to infinity (and beyond).

A couple issues have been raised about this in other repos.
mblode/vscode-twig-language#41
mblode/vscode-twig-language-2#50

@BellemareMederic
Copy link

Someone from the projet to checkup ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants