Visitar URL original
(twig) Indentation on wrapped lines is doubled · Issue #620 · prettydiff/prettydiff · GitHub
Skip to content

(twig) Indentation on wrapped lines is doubled #620

Open

Description

@OldStarchy

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

Activity

  1. BellemareMederic commented on Oct 29, 2021

    @BellemareMederic

    Someone from the projet to checkup ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions