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

Breaks indentations on try with multiple catch blocks #93

Open

Description

@pangteypiyush

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()

Activity

  1. StanAngeloff commented on Jun 20, 2019

    @StanAngeloff
    Owner

    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.

  2. pangteypiyush commented on Jun 20, 2019

    @pangteypiyush
    Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions