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

Auto Format adds extra indent #1041

Closed
processing-bugs opened this Issue Feb 10, 2013 · 12 comments

Comments

Projects
None yet
6 participants
@processing-bugs

processing-bugs commented Feb 10, 2013

Original author: mkmori...@gmail.com (February 25, 2012 05:47:28)

Another MINOR (but weird) Auto Format thing--even more trivial than my "} else {" thing, Issue 325....

Copy & paste the bit of code below--including curly brackets--into the IDE and Auto Format: The "camera.beginHUD();" line will have an extra indent! (1.5.1 & 2.0a4)

FWIW!

{ //Must be at least one indent already....
box(a); //intervening comment--comments could all be on same line with code....
//blah blah
//blah blah a

box(b); //Autoformat: Code with "a" near the end--");" doesn't matter--followed by comments ending in "a" plus one or more blank lines force an extra indent here!

box(c);
//Any matching alphanumeric character seems to do it....
}

Original issue: http://code.google.com/p/processing/issues/detail?id=1003

@gizmoabhinav

This comment has been minimized.

Show comment
Hide comment
@gizmoabhinav

gizmoabhinav Apr 12, 2013

I seem to have found the mistake causing this issue.
If only someone could guide me about how to commit that correction.
Thank You

gizmoabhinav commented Apr 12, 2013

I seem to have found the mistake causing this issue.
If only someone could guide me about how to commit that correction.
Thank You

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Apr 17, 2013

Member

These are the current build instructions:
https://github.com/processing/processing/wiki/Build-Instructions
And you can just submit a pull request here on github.

Member

benfry commented Apr 17, 2013

These are the current build instructions:
https://github.com/processing/processing/wiki/Build-Instructions
And you can just submit a pull request here on github.

@GKFX

This comment has been minimized.

Show comment
Hide comment
@GKFX

GKFX Dec 1, 2013

Contributor

To clarify benfry's "just submit": https://help.github.com/articles/using-pull-requests

Contributor

GKFX commented Dec 1, 2013

To clarify benfry's "just submit": https://help.github.com/articles/using-pull-requests

@GKFX

This comment has been minimized.

Show comment
Hide comment
@GKFX

GKFX May 26, 2014

Contributor

This is the minimal case:

{
  q;//q

    b;
}
Contributor

GKFX commented May 26, 2014

This is the minimal case:

{
  q;//q

    b;
}

GKFX added a commit to GKFX/processing that referenced this issue Sep 28, 2014

Fixed #2540, #1041, and EOF checks in autoformat
This adds proper support for indents caused by continuing to a new line, allows arrays to be expressed in more compact form, prevents the final line being eaten if it isn't properly ended, and neatens code.

GKFX added a commit to GKFX/processing that referenced this issue Sep 28, 2014

Fixed #2540, #1041, and EOF checks in autoformat
This adds proper support for indents caused by continuing to a new line, allows arrays to be expressed in more compact form, prevents the final line being eaten if it isn't properly ended, and neatens code.

@benfry benfry added help wanted and removed bug labels Nov 15, 2014

@datguy

This comment has been minimized.

Show comment
Hide comment
@datguy

datguy Jan 9, 2015

Contributor

This appears to be fixed in 2.2.1

Contributor

datguy commented Jan 9, 2015

This appears to be fixed in 2.2.1

@GKFX

This comment has been minimized.

Show comment
Hide comment
@GKFX

GKFX Jan 9, 2015

Contributor

OK, let me take a look.

Contributor

GKFX commented Jan 9, 2015

OK, let me take a look.

@GKFX

This comment has been minimized.

Show comment
Hide comment
@GKFX

GKFX Jan 9, 2015

Contributor

@datguy I disagree. The bug still appears on my system.

Contributor

GKFX commented Jan 9, 2015

@datguy I disagree. The bug still appears on my system.

@datguy

This comment has been minimized.

Show comment
Hide comment
@datguy

datguy Jan 9, 2015

Contributor

@GKFX What OS are you using? Can you give me steps to reproduce it?

I tried the minimal case that you provided - using 2.2.1 on Windows 7 - and it looked fine to me. But maybe I'm doing it differently or not looking at the right thing.

Contributor

datguy commented Jan 9, 2015

@GKFX What OS are you using? Can you give me steps to reproduce it?

I tried the minimal case that you provided - using 2.2.1 on Windows 7 - and it looked fine to me. But maybe I'm doing it differently or not looking at the right thing.

@GKFX

This comment has been minimized.

Show comment
Hide comment
@GKFX

GKFX Jan 9, 2015

Contributor

I'm on Ubuntu 14.04, but surely this is OS-independent: it's just manipulating a string. The problem is that the b; should move back two spaces, to be in line with the q;, but it doesn't. I trigger the bug by the simple method of pasting it in and pressing Ctrl+T.

Contributor

GKFX commented Jan 9, 2015

I'm on Ubuntu 14.04, but surely this is OS-independent: it's just manipulating a string. The problem is that the b; should move back two spaces, to be in line with the q;, but it doesn't. I trigger the bug by the simple method of pasting it in and pressing Ctrl+T.

@joelmoniz

This comment has been minimized.

Show comment
Hide comment
@joelmoniz

joelmoniz Jan 9, 2015

Member

This problem still occurs for me as well, on Windows 8.1.

NB: Both the new line and the comment in the minimal case are essential for this bug to show, as otherwise, the auto-format works fine.

Member

joelmoniz commented Jan 9, 2015

This problem still occurs for me as well, on Windows 8.1.

NB: Both the new line and the comment in the minimal case are essential for this bug to show, as otherwise, the auto-format works fine.

@GKFX

This comment has been minimized.

Show comment
Hide comment
@GKFX

GKFX Jan 9, 2015

Contributor

I have fixed this bug -- #3002 contained a regression, but I was able to fix it.

Contributor

GKFX commented Jan 9, 2015

I have fixed this bug -- #3002 contained a regression, but I was able to fix it.

@datguy

This comment has been minimized.

Show comment
Hide comment
@datguy

datguy Jan 9, 2015

Contributor

Now I understand why I didn't see it. I was expecting something to move when I used autoformat (as the issue title suggests), but the minimal case already had the extra indentation.

Contributor

datguy commented Jan 9, 2015

Now I understand why I didn't see it. I was expecting something to move when I used autoformat (as the issue title suggests), but the minimal case already had the extra indentation.

@benfry benfry closed this in #3002 Jan 19, 2015

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