2072 / PHP-Indenting-for-VIm

The official VIm indent script for PHP
http://www.2072productions.com/to/phpindent.txt
128 stars 29 forks source link

Fix comment indenting #14

Closed char101 closed 11 years ago

char101 commented 11 years ago

Before:

/**
    *

/*
*

After:

/**
 *

/*
 *
2072 commented 11 years ago

Vim has a built-in comment formatting system, this patch should not be required. The indent script enables this system automatically unless PHP_autoformatcomment is set to 0

Type :help php-indent and read the details about the PHP_autoformatcomment option

Another script might be interfering check the value of ":set comments" (it should be: "s1:/,mb:,ex:*/,://,:#") and ":set formatoptions" should return the following flags: qrowcb

char101 commented 11 years ago

Here are the values of the settings you mentioned

echo b:PHP_autoformatcomment

1

set comments?

comments=s1:/,mb:,ex:*/,://,:#

setlocal formatoptions?

formatoptions=qrowcb

As you can see the values are as you wrote it should be. But without adding the \?, the comments are still indented incorrectly.

char101 commented 11 years ago

After I test it again now, it works fine without the change. Could be a vim patch bug since I have just recompiled vim.

Thanks.