updated for version 7.3.249
Problem: Wrong indenting for array initializer.
Solution: Detect '}' in a better way. (Lech Lorens)
diff --git a/src/misc1.c b/src/misc1.c
index d69f12f..c7f2f80 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -7945,8 +7945,7 @@
* 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 */
{
diff --git a/src/testdir/test3.in b/src/testdir/test3.in
index 1cfd8f2..aea055f 100644
--- a/src/testdir/test3.in
+++ b/src/testdir/test3.in
Binary files differ
diff --git a/src/testdir/test3.ok b/src/testdir/test3.ok
index 8475aff..a475669 100644
--- a/src/testdir/test3.ok
+++ b/src/testdir/test3.ok
@@ -1310,6 +1310,31 @@
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"
<< "b"
<< ") :"
diff --git a/src/version.c b/src/version.c
index a501f5e..a138681 100644
--- a/src/version.c
+++ b/src/version.c
@@ -710,6 +710,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 249,
+/**/
248,
/**/
247,