Posted September 24th, 2006 by Luminari
Is there a way in vs.php 2.1 to customize the formatting options. Ever since I got vs.php it incorrectly formats brackets by indenting the closing bracket, so every time I type brackets I have to hit backspace to get rid of the extra tab. Has this option been fixed?
Thanks
juanc says:
There is some customization support already in VS.Php. Could you provide us with more details on the issue you are experiencing?
Luminari says:
Here is an example:
if ($something == true) {
//When I hit enter the cursor goes to this line
}//Notice Bracket is indented, where it should not be
Thats what I'm trying to fix, many people use the following coding style, which I would like to use:
if ($something == true){
//Cursor Starts here when enter is hit on above line
}//Notice bracket stays lined up with if statement
Is this possible?
juanc says:
The way you would like it to be is how it is supposed to behave. The only issue is that if there are syntax errors in the code sometimes it does not indent correctly. This happens when you are in the middle of the code.
One thing I do every so often is Ctrl+K Ctrl+D to format the whole file.
Are you seen the improper indentation with code that does not have syntax errors?
Luminari says:
I never see the correct indentation. If I type if(true){} and then hit enter in between the open and close braces, it always indents incorrectly.
anonymous_coward says:
Go to the Tools > Text Editor > PHP > Tabs
and set indenting to Block.
That took care of it for me.
Rooster says:
Setiing it to block does NOT fix it for me.
zibtech says:
I'll say this much, setting the formatting method to 'Block' certainly makes the formatting bearable, but it certainly doesn't fix the problem. I'd also like to see some better formatting customization options available.
- Andrew