Home page

756,445 Visitors, Sunday 21 July 2024 18:11:44 CEST, IP:

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

Changelog of php.vim

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

 Changes: 1.75         - Fix #87: The indent optimization was causing wrong
			  indentation of lines preceded by a line ending with
			  '}' when preceded by non white characters.
			- Fix long standing non-reported regex escaping issue
			  in cleaning end of line comments function. This
			  should help fixing some other unreported issues when
			  parts of codes are commented out at ends of lines...

 Changes: 1.74         - Fix #86: Add support for `match` expression.

 Changes: 1.73         - Fix #77 where multi line strings and true/false
			  keywords at beginning of a line would cause indentation failures.

 Changes: 1.72         - Fix vim/vim#5722 where it was reported that the
			  option PHP_BracesAtCodeLevel had not been working for the last 6 years.

 Changes: 1.71         - Fix #75 where the indent script would hang on
			  some multi-line quoted strings.

 Changes: 1.70         - Rename PHP_IndentFunctionParameters to PHP_IndentFunctionCallParameters and
			  also implement PHP_IndentFunctionDeclarationParameters.
			- Update documentation.

 Changes: 1.69         - Fix vim/vim#4562 where Vim would freeze on multiline-string declarations ending with a comma.
			- Fix #69: Indenting was incorrect for closures with single-line `use` statements.
			- Always indent `^\s*[)\]]` according to their opening counterpart. This is slower but computers have
			  improved in the last 15 years...
			- Implement feature request #71: added option PHP_IndentFunctionParameters to be set to the number of
			  additional indents you want for your function parameters.
			- Fix #60 where multiline-string declarations endings with nothing else before would break indentation.
			- Fix unreported issue where a comment ending with a ', " or ` would stop indentation after this line.

 Changes: 1.68         - Fix #68: end(if|for|foreach|while|switch)
			  identifiers were treated as here doc ending indentifiers and set at column 0.
			- WIP: More work on #67: arrow matching involving () not behaving as expected (better but not perfect).

 Changes: 1.67         - Fix #67: chained calls indentation was aligning on the
			  first matching '->' instead of the last one.

 Changes: 1.66         - Add support for return type declaration on multi-line
		          function declarations (issue #64)
		        - Fix to multi-line function declaration argument
		          indentation (issue #63)

 Changes: 1.65         - Functions declared as returning references were not
                         indented properly (issue #62).

 Changes: 1.64         - Always ignore case when using syntax highlighting names (issue #52)
			- Fix bug introduced in 1.63 (the content of anonymous function
			  declarations preceded by a '->' was no longer
			  indented correctly) (issue #59)
			- Add a new PHP_noArrowMatching option to disable '->'
			  indentation matching on multi-line chained calls (issue #59).

 Changes: 1.63         - Fix chained multi-line '->' indentation (issue #54 and #59)
                       - Fix array indentation when PHP_vintage_case_default_indent is set (issue #58)

 Changes: 1.62         - Fix some multi-line block declaration interferences (issue #49)
			- Fix Grouped 'use' declaration (issue #48)
			- Fix array index issue with function call (issue #54)
			- Add anonymous class declaration support (issue #55)

 Changes: 1.61         - Prevent multi-line strings declaration from breaking
                         indentation. (issue #47)

 Changes: 1.60         - Multi-line indenting could get wrong whenever started
                         on a commented line. (issue #44)

 Changes: 1.59		- Add support for optional spaces before and double
                         quotes around (Here|Now)Document identifiers (issue #40)

 Changes: 1.58		- Check shiftwidth() instead of 'shiftwidth' (will use
			  the 'tabstop' value if 'shiftwidth' is 0)

 Changes: 1.57		- Fix an unreported non-blocking syntax error (VimLint)

 Changes: 1.56		- Enhance closure support in array definition
			- Correctly indent line starting by a /**/ comment
			- Don't indent last line of multiline string

 Changes: 1.55		- Remove optimization related to labels detection that
			  could trigger indent issues when URLs are found in
			  comments at end of lines...

 Changes: 1.54		- Add support for 'phpDocComment' syntax identifier

 Changes: 1.53		- Add support for `label:` (used with `goto`)
			- Add `0]` to indentkeys

 Changes: 1.52		- Fix an edge case in conditional block declarations
			  when the ')' of the condition is put on the same
			  line as the following '{' (complement to issue #4)

 Changes: 1.51		- Fix issue #34 where indentation could get wrong with
			  arrays defined using the short [] declaration.

 Changes: 1.50		- Allow the PHP_autoformatcomment option (default on)
			  to work for any filetype containing 'php'.

 Changes: 1.49		- Added 'finally' as a block starter

 Changes: 1.48		- The 'use' keyword is now seen as a block starter (as
			  used to handle trait conflicts resolution).

			- Fix a issue with lines following a {} block defined
			  on a single line if this {} block was just beneath a '{'

 Changes: 1.47		- Code in traits was not indented

 Changes: 1.46		- Fix issue #32 ('case:/default:' indentation issues in
			  complex 'switch' blocks)

 Changes: 1.45		- Implemented support for multi-line block
			  declarations (issue #4).

			- Other small and very specific issues were discovered
			  and fixed while implementing this.

 Changes: 1.44		- Fix issue #31 introduced in 1.43

 Changes: 1.43		- Fix issue #17 where closures' content would get
			  extra indenting.

 Changes: 1.42		- Added support (with some restrictions) for
			  multi-line string declarations (issue #22).

 Changes: 1.41		- Fix handing of ^}\s*else\n{ blocks which were not
			  detected as new blocks and resulted in wrong indentation.

			- Fix issue #23 where the script could hang in some
			  specific cases involving closing braces at column 0;

			- Fix issue #6 where nested switches would not indent

 Changes: 1.40		- Added the 'final' keyword as a block starter so final
			  classes' code is indented correctly.

			- No longer add 'w' to formatoptions VIm' setting as
			  no other file-type plug-in uses it by default. This
			  prevents leaving trailing white spaces when text

 Changes: 1.39		- Also add 'StorageClass' syntax identifier (with an uppercase C) as it
			  also exists in the syntax file.

 Changes: 1.38		- Fix an incredibly old bug that managed to survive
			  unnoticed until today: the PHP code identifier routine was missing a few
			  syntax names (Define, Structure, Storageclass and Exception). If you started
			  indenting on such a line, nothing would happen as
			  the script thought it wasn't actual PHP code...

 Changes: 1.37		- Fix a bug for inline script element [imicky]
			- Fix issue #11: https://github.com/2072/PHP-Indenting-for-VIm/issues/11

 Changes: 1.36		- Added support for short array declaration (Thanks to
			  Warren Seymour)

 Changes: 1.35		- New option: PHP_outdentSLComments to add extra
			  indentation to single-line comments.

 Changes: 1.34		- Fix: string with /* would be treated as comment
			  start when using single quote. (Thanks to Manic Chuang
			  for the fix)

 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

 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 (https://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
			- When PHP_autoformatcomment is not 0, the 'comments'
			  setting is set to the type of comments that PHP

 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:


				You have:


			- 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
			- 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 '{}'
		    - 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
		    - 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

 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
		      That will be corrected in the next version.

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

Valid HTML 4.01! Best viewed in sRGB Valid CSS!
Previous page - Next page
This page has been seen 7,659 times ; last update: Tue Sep 5 12:27:39 2023
Copyright © 2001 - 2024 John Wellesz
All rights reserved.
All trademarks and registered trademarks mentioned on this website are the properties of their respective companies.

Privacy Policy