Problem: cindent: wrong indentation after an array declaration
Solution: check if the filetype if javascript before matching the syntax
(Anttoni Erkkilä)
cindent matches a javascript syntax for C files causing wrong
indentation in the following case:
```
void foo() {
float a[5],
b;
}
```
closes: #18631
Signed-off-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
amount = cur_amount;
n = (int)STRLEN(l);
- if (terminated == ',' && (*skipwhite(l) == ']'
+ if (curbuf->b_ind_js && terminated == ',' && (*skipwhite(l) == ']'
|| (n >=2 && l[n - 2] == ']')))
break;
}
}
+ void foo() {
+ float a[5],
+ b;
+ }
+
/* end of AUTO */
[CODE]
}
}
+ void foo() {
+ float a[5],
+ b;
+ }
+
/* end of AUTO */
[CODE]
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1877,
/**/
1876,
/**/