Skip to content

Curly brackets sometimes remove one level of indentation #2

Open
@Siguza

Description

@Siguza

Curly brackets ({ and }) tend to mess up indentation when pasted or typed in a zephir file.

For these examples, all code can be pasted inside an empty class to provide one level of indentation.

class Test
{
    // here
}

In the following snippets, the curly brackets and the code in between gets a wrong indentation level:

Pasted code:

function abc()
{
}

Result:

class Test
{
    function abc()
{
}
}

Pasted code:

if a == b
{
}

Result:

class Test
{
    if a == b
{
}
}

Pasted code:

loop
{
}

Result:

class Test
{
    loop
{
}
}

However, if brackets are used in an if construct, the indentation level is as expected:

Pasted code:

if(a == b)
{
}

Result:

class Test
{
    if(a == b)
    {
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions