Force indent after <?php statement in PHP files

Syntax highlighting, code folding, brace matching, code indenting, and function list

Force indent after <?php statement in PHP files

Postby vgehts » Sun Dec 19, 2010 11:40 pm

I have searched the FAQs and the other topics for how to alter what triggers an indent. I found one topic that explained how to go into the wordfile for C++ and change the /Indent Strings and /Unident Strings values. I'm trying to do this with php file where I want to have it indent after the initial <?php line. I thought it would be as simple as going in to the /Indent Strings and changing it from "{" to "{" "<?php" and changing the /Unident Strings from "}" to "}" "?>", but that does not seem to work. Can someone tell me how to modify the wordfile so that it indents after a "<?php" line and unindents after a ?> line?

Thanks,
Richard
vgehts
Newbie
 
Posts: 5
Joined: Sat Feb 14, 2009 9:44 pm
Location: Saint Louis, MO USA

Re: Force indent after <?php statement in PHP files

Postby Mofi » Mon Dec 20, 2010 5:11 am

Replace in file %appdata%\IDMComp\UltraEdit\wordfiles\php.uew the 2 lines

/Indent Strings = "{"
/Unindent Strings = "}"


by

/Indent Strings = "{" "?php"
/Unindent Strings = "}" "?>"

As you can see in the box left the date of last modification in the status bar at bottom of UltraEdit window the character < of <?php is highlighted by the wordfile for HTML if you set the caret left <. And with caret moving one character to right, left of ?, you can see that the wordfile for PHP is active for this character. Therefore the indent/unindent strings as I wrote above must be added to wordfile for PHP.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4054
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Force indent after <?php statement in PHP files

Postby vgehts » Mon Dec 20, 2010 1:43 pm

Thanks. Using "?php" instead of "<?php" did the trick.
vgehts
Newbie
 
Posts: 5
Joined: Sat Feb 14, 2009 9:44 pm
Location: Saint Louis, MO USA


Return to Syntax Highlighting