php.vim
php.vim copied to clipboard
Breaks indentations on try with multiple catch blocks
php.vim plugin enabled:
<?php
namespace Abc;
class Xyz
{
public function __construct()
{
try {
// cause exception
} catch (\AbcException $e) {
// handle AbcException
} catch (\PqrException $e) {
// handle PqrException
}
}
}
function func() {
try {
// cause exception
} catch (\AbcException $e) {
// handle AbcException
} catch (\PqrException $e) {
// handle PqrException
}
}
php.vim plugin disabled:
<?php
namespace Abc;
class Xyz
{
public function __construct()
{
try {
// cause exception
} catch (\AbcException $e) {
// handle AbcException
} catch (\PqrException $e) {
// handle PqrException
}
}
}
function func() {
try {
// cause exception
} catch (\AbcException $e) {
// handle AbcException
} catch (\PqrException $e) {
// handle PqrException
}
}
NVIM v0.3.7
vimrc (link):
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'tobyS/vmustache'
Plugin 'tobyS/pdv'
Plugin 'StanAngeloff/php.vim'
Plugin 'lvht/phpcd.vim'
call vundle#end()
This seems to be caused by setting php_folding = 1. That feature creates new syntax groups which the built-in indentation doesn't support.
I don't think there's a workaround other than using php_folding = 0 or omitting setting the variable altogether.
This works fine for me since I don't use php_folding heavily.