reindent code |
Veteran
|
no comments?
|
||||||||||||
|
Site Admin
|
Could you please tell me what's wrong with PolyStyle?
|
||||||||||||
|
Veteran
|
This is wrong for me:
1) It's a very heavy application 2) I can't reindent just some lines of my script 3) I can't undo the reindent 4) I don't like the way it reindent the code (eg I like to have { at the end of the line, not so lonely on the next line of the construct (if, while...) eg. 2: I like the more compact: if ($x>2) { bla bla bla } and not like polystile does: if ($x>2) { bla bla bla } I like very much how Eclipse works to reindent the code |
||||||||||||
|
Site Admin
|
I got it. Thanks.
|
||||||||||||
|
|
I'd like to second this. Especially the ability to simply and quickly reindent a few selected lines of code (renesting 'if's and classes/functions in particular). This is something I miss that I use a lot in ZDE. With a local, incremental reindent available, I almost never feel the need to do a wholesale reformat my code in the way that PolyStyle does and have a lot more confidence that a major reformat hasn't done something obscure that I wish it hadn't. |
||||||||||||||
|
Site Admin
|
I got it, thanks.
So we're talking about a lightweight feature that just takes the lestmost spaces on every line and adjust them according to the nesting level. Latter one increments with each { and decrements with }. No other reformatting is needed. Right? |
||||||||||||
|
|
Right, mostly... Comments or comment blocks that are not indented at all are left on the left margin. Comments or comment blocks that are indented are aligned with the first line of code following the comment or comment block. Also, if no text selected, indenting is applied to the whole file. And a single undo returns all re-indented text to the way it was before the indenting was applied. So...
becomes...
The only possible exception to the {} rule that I'm aware of is switch:
becomes...
Hope that still looks lightweight |
||||||||||||||||||||||
|
Site Admin
|
looks good with one notice
if
to me the resulting code should look like:
or did I miss a point? |
||||||||||||||||||||||
|
|
No. You're quite right. I was trying to sneak in a personal thing and you caught me Sometimes, when I'm commenting code in order to test alternatives, I'll deliberately put the comment slashes on the left margin so that I can easily find disabled code, as opposed to real comments:
Most automatic indenting routines do just as you say and align the comment:
And then I have to manually move them back over to the margin, or delete the commented code, or wait to adjust the indents. This is actually not a very big deal, but it would be a nice thing, for me at least. But I'll bet it would result in a support question or two. |
||||||||||||||||||
|
Site Admin
|
so the lines with comments one the leftmost positions should not be re-indented
|
||||||||||||
|
|
Yes. That would be great.
|
||||||||||||
|
reindent code |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by