diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index d197e78187..fa85a0de47 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -3179,9 +3179,8 @@ int get_c_indent(void) amount = cur_amount; n = (int)strlen(l); - if (terminated == ',' - && (*skipwhite(l) == ']' - || (n >= 2 && l[n - 2] == ']'))) { + if (curbuf->b_ind_js && terminated == ',' + && (*skipwhite(l) == ']' || (n >= 2 && l[n - 2] == ']'))) { break; } diff --git a/test/old/testdir/test_cindent.vim b/test/old/testdir/test_cindent.vim index d9702f57d2..170da533d1 100644 --- a/test/old/testdir/test_cindent.vim +++ b/test/old/testdir/test_cindent.vim @@ -1101,6 +1101,11 @@ func Test_cindent_1() } } + void foo() { + float a[5], + b; + } + /* end of AUTO */ [CODE] @@ -2078,6 +2083,11 @@ func Test_cindent_1() } } + void foo() { + float a[5], + b; + } + /* end of AUTO */ [CODE]