Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Breaks indentations on try with multiple catch blocks #93

Open
pangteypiyush opened this issue Jun 19, 2019 · 2 comments
Open

Breaks indentations on try with multiple catch blocks #93

pangteypiyush opened this issue Jun 19, 2019 · 2 comments

Comments

@pangteypiyush
Copy link

pangteypiyush commented Jun 19, 2019

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()
@StanAngeloff
Copy link
Owner

StanAngeloff commented Jun 20, 2019

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.

@pangteypiyush
Copy link
Author

This works fine for me since I don't use php_folding heavily.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants