On 4/12/06, Adam Krolnik <[EMAIL PROTECTED]> wrote:
>
>
> It is strange to see that the option foldignore doesn't seem to work for the
> '#' character.
>
> Here is a C program that has preprocessor statements. I'd like to fold this
> using
> indent and foldignore=^L`#
>
> When I do that and fold the code, it does not show up as folded.
> It shows up like:
>
> static void
> MouseReadInput(InputInfoPtr pInfo)
> {
>
> +-- 2 lines: while ((c = XisbRead(pMse->buffer)) >= 0)
> {---------------------------------------------
>
> #if defined (EXTMOUSEDEBUG) || defined (MOUSEDATADEBUG) This one doesn't fold
> ErrorF("mouse byte: %2.2x\n",u);
> #endif
> #if 1 This doesn't fold
> +-- 12 lines: if (pBufP >= pMse->protoPara[4])
> {------------------------------------------------------
> #ifdef EXTMOUSEDEBUG This doesn't fold
> ErrorF("mouse 4th byte %02x\n",u);
> #endif
> }
>
> If I change the # character to backtick, they all fold up.
> s
> tatic void
> MouseReadInput(InputInfoPtr pInfo)
> {
>
> +-- 21 lines: while ((c = XisbRead(pMse->buffer)) >= 0)
> {---------------------------------------------
> `endif
> }
>
>
> Here is the original code. Any thoughts? This works the same for Vim 6.3 and
> 7.0...
>
> -------------------------------------------------------------------------------------
>
> static void
> MouseReadInput(InputInfoPtr pInfo)
> {
>
> while ((c = XisbRead(pMse->buffer)) >= 0) {
> u = (unsigned char)c;
>
> #if defined (EXTMOUSEDEBUG) || defined (MOUSEDATADEBUG) This one doesn't fold
> ErrorF("mouse byte: %2.2x\n",u);
> #endif
> #if 1 This doesn't fold
> if (pBufP >= pMse->protoPara[4]) {
> /*
> * Buffer contains a full packet, which has already been
> processed:
> * Empty the buffer and check for optional 4th byte, which will
> be
> * processed directly, without being put into the buffer first.
> */
> pBufP = 0;
> if ((u & pMse->protoPara[0]) != pMse->protoPara[1] &&
> (u & pMse->protoPara[5]) == pMse->protoPara[6]) {
> /*
> * Hack for Logitech MouseMan Mouse - Middle button
> */
> #ifdef EXTMOUSEDEBUG This doesn't fold
> ErrorF("mouse 4th byte %02x\n",u);
> #endif
> }
Works for me (vim7.0d01). Can you reproduce it with 'vim -u NONE -U NONE' ?
If you can reproduce it: which sequence of option settings and
user input reproduces it ?
Yakov