Closed webplantmedia closed 10 years ago
try to disable simple-javacript-indenter.
Also not that the php indent script ignores HTML, it just let it as is, the only exception being the content of javascript tags.
I had originally tested it on Vim 7.4 without any plugins activated. And the behavior was exactly the same. I'm not trying to get HTML indent to work inside *.php files. But I am trying to figure out why my php doesn't indent when outside <?php .. ?> as described in your examples under the section "A more complete example of its capabilities:"
What's the best way to reproduce this potential bug? Is this not a problem anyone else has had?
I don't understand what you mean, in the example you are referring to (http://www.2072productions.com/to/phpindent.txt ) indented PHP code is inside PHP tags... There is php code outside tags just to show that the indent script doesn't touch it.
I'm sorry for not being clearer. In your documentation, you give a specific example of your php indent in action
However, when I try to do the same thing inside of my php file, the php indent script produces the following
What makes this particular problem inconvenient is that any new line of code inside my php file, when placed outside <?php ... ?>, always places my cursor in the first character position.
I hope this is clearer. This is still a great plugin. I'm hoping it's something with my configuration. I tested this on a clean Vim 7.4 installation.
Actually, the problem is that the indent script doesn't support the alternative syntax you are using for control structure ( http://php.net/manual/en/control-structures.alternative-syntax.php ).
As for the example from my website not behaving the same, it's because you're missing the first lines :
<?php
if ($foo="thing") // as you see an opened bracket isn't needed to indent correctly
if (foo("something"))
{
somethingelse("blabla");
?>
Why is the alternative syntax not supported though?
Because I created this indentation script more than 13 years ago and you are the first person to ask this question.
Indents inside php files is not acting as the way described in the readme file.
However, I know the plugin is working because writing code inside of functions works perfectly. Even writing switch statements. I can also read the help text provided from within vim.
I downloaded 7.4.22 MacVim and Vim from homebrew on my Mac.
Notable settings in my .vimrc include: filetype plugin indent on set nocompatible set noexpandtab set shiftwidth=4 set tabstop=4 set softtabstop=4 set lbr set tw=500 set showbreak=-----> set nosmartindent set autoindent set nocindent set wrap "Wrap lines let g:PHP_vintage_case_default_indent = 1 let g:PHP_removeCRwhenUnix = 1
Here is a snapshot of plugins I'm using along with pathogen.
Is there any settings that I need set or disabled? Or are there any plugins that can conflict with php-indent? Thanks!