Problem: Wrong indenting for array initializer.
Solution: Detect '}' in a better way. (Lech Lorens)
* 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 */
{
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=][
}
+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"
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 249,
/**/
248,
/**/