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

fix nextline indentation when has // in code #32

Closed
wants to merge 1 commit into from
Closed

fix nextline indentation when has // in code #32

wants to merge 1 commit into from

Conversation

sleetdrop
Copy link
Contributor

for example:
iconv("GBK", "UTF-8//IGNORE", $str);
the next line will indent

for example:
iconv("GBK", "UTF-8//IGNORE", $str);
the next line will indent
@infininight
Copy link
Member

This fails on the line:

iconv("GBK", "UTF-8//IGNORE", $str); // test

There are a few other cases as well but they were more contrived than this one.

@infininight
Copy link
Member

Unfortunately I think this is just one of those edge cases that isn't possible to fix with the current implementation of the indention system, closing issue.

@sorbits
Copy link
Member

sorbits commented Sep 28, 2013

A heuristic fix could be to require (^|\s) before //. Should probably search some large PHP code bases first, to see if anyone does line comments without leading whitespace.

infininight added a commit that referenced this pull request Nov 5, 2013
Rather than try to match lines that should cause the next line to be indented we now rule out lines that should prevent it from being so. Fixes #38 and #32.
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

Successfully merging this pull request may close these issues.

3 participants