Home page

507,947 Visitors, Friday 03 September 2010 18:11:04 CEST, IP: 38.107.191.119

Return to parent page: PHP-correct-Indenting for Vim

Changelog of php.vim

(the php indent script for vim)
The current version is: 1.33

 Changes: 1.33         - Rewrote Switch(){case:default:} handling from
                         scratch in a simpler more logical and infallible way...
                       - Removed PHP_ANSI_indenting which is no longer
                         needed.


 Changes: 1.32b        - Added PHP_ANSI_indenting and PHP_outdentphpescape
                         options details to VIm documentation (:help php-indent).


 Changes: 1.32         - Added a new option: PHP_ANSI_indenting


 Changes: 1.31a        - Added a new option: PHP_outdentphpescape to indent
                         PHP tags as the surrounding code.

 Changes: 1.30         - Fixed empty case/default indentation again :/
                       - The ResetOptions() function will be called each time
                         the ftplugin calls this script, previously it was
                         executed on BufWinEnter and Syntax events.


 Changes: 1.29         - Fixed php file detection for ResetOptions() used for
                         comments formatting. It now uses the same tests as
                         filetype.vim. ResetOptions() will be correctly
                         called for *.phtml, *.ctp and *.inc files.


 Changes: 1.28         - End HEREDOC delimiters were not considered as such
                         if they were not followed by a ';'.
                       - Added support for NOWDOC tags ($foo = <<<'bar')


 Changes: 1.27         - if a "case" was preceded by another "case" on the
                         previous line, the second "case" was indented incorrectly.

 Changes: 1.26         - '/*' character sequences found on a line
                         starting by a '#' were not dismissed by the indenting algorithm
                         and could cause indentation problem in some cases.


 Changes: 1.25         - Fix some indentation errors on multi line conditions
                         and multi line statements.
                       - Fix when array indenting is broken and a closing
                       ');' is placed at the start of the line, following
                       lines will be indented correctly.
                       - New option: PHP_vintage_case_default_indent (default off)
                       - Minor fixes and optimizations.


 Changes: 1.24         - Added compatibility with the latest version of
                         php.vim syntax file by Peter Hodge (http://www.vim.org/scripts/script.php?script_id=1571)
                         This fixes wrong indentation and ultra-slow indenting
                         on large php files...
                       - Fixed spelling in comments.


 Changes: 1.23         - <script> html tags are now correctly indented the same
                         way their content is.
                       - <?.*?> (on a single line) PHP declarations are now
                         always considered as non-PHP code and let untouched.

 Changes: 1.22         - PHPDoc comments are now indented according to the
                         surrounding code.
                       - This is also true for '/* */' multi-line comments
                         when the second line begins by a '*'.
                       - Single line '/* */' comments are also indented.


 Changes: 1.21         - 'try' and 'catch' were not registered as block starters so the '{'
                         after a 'try' or 'catch' could be wrongly indented...
                         (thanks to Gert Muller for finding this issue)

 Changes: 1.20         - Line beginning by a single or double quote followed
                         by a space would cause problems... this was related
                         to the bug correction of version 1.10 - Thanks to
                         David Fishburn for finding this (he was lucky).
                       - Changed the way this script set the 'formatoptions'
                         setting, now it uses '-=' and '+='
                       - New option: PHP_autoformatcomment (defaults to 1),
                         if set to 0 the 'formatoptions' setting will not be
                         altered.
                       - When PHP_autoformatcomment is not 0, the 'comments'
                         setting is set to the type of comments that PHP
                         supports.

 Changes: 1.19         - Indentation of '*/' delimiter of '/**/' won't be broken by
                         strings or '//' comments containing the "/*" character sequence.

 Changes: 1.182        - I Forgot to register 'interface' and 'abstract' as block starters so the '{'
                         after them could be wrongly indented...

 Changes: 1.181        - I Forgot to register 'class' as a block starter so the '{'
                         after a 'class' could be wrongly indented...

 Changes: 1.18         - No more problems with Vim 6.3 and UTF-8.
                       - Opening braces "{" are always indented according to their block starter.

                               Instead of:

                                       if( $test
                                           && $test2 )
                                           {
                                           }

                               You have:

                                       if( $test
                                           && $test2 )
                                       {
                                       }


 Changes: 1.17         - Now following parts of split lines are indented:

                               Instead of:

                                       $foo=
                                       "foo"
                                       ."foo";

                               You have:

                                       $foo=
                                           "foo"
                                           ."foo";

                       - If a "case : break;" was declared on a single line, the
                         following "case" was not indented correctly.
                       - If a </script> html tag was preceded by a "?>" it wasn't indented.
                       - Some other minor corrections and improvements.


 Changes: 1.16         - Now starting and ending '*' of multiline '/* */' comments are aligned
                         on the '*' of the '/*' comment starter.
                       - Some code improvements that make indentation faster.

 Changes: 1.15         - Corrected some problems with the indentation of
                         multiline "array()" declarations.

 Changes: 1.14         - Added auto-formatting for comments (using the Vim option formatoptions=qroc).
                       - Added the script option PHP_BracesAtCodeLevel to
                         indent the '{' and '}' at the same level than the
                         code they contain.

 Changes: 1.13         - Some code cleaning and typo corrections (Thanks to
                         Emanuele Giaquinta for his patches)

 Changes: 1.12         - The bug involving searchpair() and utf-8 encoding in Vim 6.3 will
                         not make this script to hang but you'll have to be
                         careful to not write '/* */' comments with other '/*'
                         inside the comments else the indentation won't be correct.
                         NOTE: This is true only if you are using utf-8 and vim 6.3.

 Changes: 1.11         - If the "case" of a "switch" wasn't alone on its line
                         and if the "switch" was at col 0 (or at default indenting)
                         the lines following the "case" were not indented.

 Changes: 1.10         - Lines beginning by a single or double quote were
                         not indented in some cases.

 Changes: 1.09         - JavaScript code was not always directly indented.

 Changes: 1.08         - End comment tags '*/' are indented like start tags '/*'.
                       - When typing a multiline comment, '}' are indented
                         according to other commented '{'.
                       - Added a new option 'PHP_removeCRwhenUnix' to
                         automatically remove CR at end of lines when the file
                         format is Unix.
                       - Changed the file format of this very file to Unix.
                       - This version seems to correct several issues some people
                         had with 1.07.

 Changes: 1.07         - Added support for "Here document" tags:
                          - HereDoc end tags are indented properly.
                          - HereDoc content remains unchanged.
                       - All the code that is outside PHP delimiters remains
                         unchanged.
                       - New feature: The content of <script.*> html tags is considered as PHP
                         and indented according to the surrounding PHP code.
                       - "else if" are detected as "elseif".
                       - Multiline /**/ are indented when the user types it but
                         remain unchanged when indenting from their beginning.
                       - Fixed indenting of // and # comments.
                       - php_sync_method option is set to 0 (fromstart).
                         This is required for complex PHP scripts else the indent
                         may fail.
                       - Files with non PHP code at the beginning could alter the indent
                         of the following PHP code.
                       - Other minor improvements and corrections.

 Changes: 1.06:    - Switch block were no longer indented correctly...
                   - Added an option to use a default indenting instead of 0.
                     (whereas I still can't find any good reason to use it!)
                   - A problem with ^\s*);\= lines where ending a non '{}'
                     structure.
                   - Changed script local variable to be buffer local
                     variable instead.

 Changes: 1.05:    - Lines containing "<?php ?>" and "?> <?php"
                     (start and end tag on the same line) are no
                     longer indented at col 1 but as normal code.

 Changes: 1.04:    - Strings containing "//" could break the indenting
                     algorithm.
                   - When a '{}' block was at col 1, the second line of the
                     block was not indented at all (because of a stupid
                     optimization coupled with a bug).

 Changes: 1.03:    - Some indenting problems corrected: end of non '{}'
                     structures was not detected in some cases. The part of
                     code concerned have been re-written
                   - PHP start tags were not indented at col 1
                   - Wrong comment in the code have been corrected

 Changes: 1.02:    - The bug I was talking about in version 1.01 (right below) has
                     been corrected :)
                   - Also corrected another bug that could occur in
                     some special cases.
                   - I removed the debug mode left in 1.01 that could
                     cause some Vim messages at loading if other script were
                     bugged.

 Changes: 1.01:    - Some little bug corrections regarding automatic optimized
                     mode that missed some tests and could break the indenting.
                   - There is also a problem with complex non bracketed structures, when several
                     else are following each other, the algorithm do not indent the way it
                     should.
                     That will be corrected in the next version.

  If you find a bug, please 
  with an example of code that breaks the algorithm.


       Thanks a lot for using this script.


Return to parent page: PHP-correct-Indenting for Vim



Valid HTML 4.01! Best viewed in sRGB A utility to annoy spammers Valid CSS!
Previous page - Next page
This page has been seen 1,260 times ; last update: Mon 26 Jul 02:13:39 2010
Copyright © 2001 - 2010 John Wellesz '2072'
All rights reserved.
All trademarks and registered trademarks mentioned on this website are the properties of their respective companies.