Hirohito Higashi wrote:

> Hi Bram and list,
> 
> How to reproduce.
> - Start pure Vim with 'set cindent'. (test.c is attached this mail)
>   $ vim -N -u NONE -c "set cin cino=" test.c
> 
> - Do indent.
>   gg=G
> 
> Expected result:
> {
>       // (1)
>       int ary[4] = {
>               [0] = 0,
>               [1] = 1,
>               [2] = 2,
>               [3] = 3,
>       };
> 
>       // (2)
>       a = b[2]
>               + 3;
> 
>       // (3)
>       if (1)
>               /* aaaaa
>                * bbbbb
>                */
>               a = 1;
> }
> 
> Actual result:
> {
>       // (1)
>       int ary[4] = {
>               [0] = 0,
>               [1] = 1,
>                       [2] = 2,
>                               [3] = 3,
>       };
> 
>       // (2)
>       a = b[2]
>       + 3;
> 
>       // (3)
>       if (1)
>               /* aaaaa
>                * bbbbb
>                */
>       a = 1;
> }
> 
> (1) Line of "[2] = 2," and "[3] = 3," indent wrong.
> (2) "+ 3;" indent wrong.
> (3) "a = 1;" indent wrong.
> 
> 
> Investigation result:
> - (1) and (2) is broken since the patch 7.4.670.
>   https://groups.google.com/d/msg/vim_dev/0nS1z0tGtnc/9h6zk-oc0LQJ
>   It's my patch. sorry.
> 
> - (3) is broken since the patch 7.4.803.
>   https://groups.google.com/d/msg/vim_dev/G6syQNGZjsQ/7TtbRF9JGgAJ
>   In ind_find_start_CORS() src/misc1.c.
>   Call find_start_comment() and receives the return value by comment_pos of 
> type of (pos_T *).
>   It's address of static pos_T pos in findmatchlimit().
>   But, next call find_start_rawstring() calls findmatchlimit().
>   This may the contents of comment_pos is changed unexpectedly.
> 
> I wrote a patch contains test.
> Please check this.

Thanks!  Especially for adding tests, it's easy to have a regression in
this code.

-- 
How To Keep A Healthy Level Of Insanity:
7. Finish all your sentences with "in accordance with the prophecy".

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui