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:
parent
734d99804b
commit
50f42cadb1
@ -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 */
|
||||
{
|
||||
|
@ -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=][
|
||||
|
@ -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"
|
||||
|
@ -709,6 +709,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
249,
|
||||
/**/
|
||||
248,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user