0
0
mirror of https://github.com/vim/vim.git synced 2025-07-24 10:45:12 -04:00

updated for version 7.3.249

Problem:    Wrong indenting for array initializer.
Solution:   Detect '}' in a better way. (Lech Lorens)
This commit is contained in:
Bram Moolenaar 2011-07-15 14:12:30 +02:00
parent 734d99804b
commit 50f42cadb1
4 changed files with 58 additions and 2 deletions

View File

@ -7945,8 +7945,7 @@ term_again:
* If we're at the end of a block, skip to the start of
* that block.
*/
curwin->w_cursor.col = 0;
if (*cin_skipcomment(l) == '}'
if (find_last_paren(l, '{', '}')
&& (trypos = find_start_brace(ind_maxcomment))
!= NULL) /* XXX */
{

View File

@ -1450,6 +1450,36 @@ void func3(void)
printf("Don't you dare indent this line incorrectly!\n);
}
STARTTEST
:set cino&
:set cino+=l1
2kdd=][
ENDTEST
void func(void)
{
int tab[] =
{
1, 2, 3,
4, 5, 6};
printf("Indent this line correctly!\n");
switch (foo)
{
case bar:
printf("bar");
break;
case baz: {
printf("baz");
break;
}
case quux:
printf("But don't break the indentation of this instruction\n");
break;
}
}
STARTTEST
:set cino&
2kdd=][

View File

@ -1308,6 +1308,31 @@ void func3(void)
}
void func(void)
{
int tab[] =
{
1, 2, 3,
4, 5, 6};
printf("Indent this line correctly!\n");
switch (foo)
{
case bar:
printf("bar");
break;
case baz: {
printf("baz");
break;
}
case quux:
printf("But don't break the indentation of this instruction\n");
break;
}
}
void func(void)
{
cout << "a"

View File

@ -709,6 +709,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
249,
/**/
248,
/**/