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

Curly brackets sometimes remove one level of indentation #2

Open
Siguza opened this issue Jan 1, 2015 · 0 comments
Open

Curly brackets sometimes remove one level of indentation #2

Siguza opened this issue Jan 1, 2015 · 0 comments

Comments

@Siguza
Copy link

Siguza commented Jan 1, 2015

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)
    {
    }
}
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

1 participant