[vim/vim] cindent: wrong indentation after an array declaration (PR #18631)

3 views
Skip to first unread message

aerkkila

unread,
Oct 24, 2025, 4:41:12 PM (8 days ago) Oct 24
to vim/vim, Subscribed

Problem:
cindent matches a javascript syntax for C files
causing wrong indentation in the following case
float a[5],
b; <- this is not aligned with 'a' if we are inside curly braces

Solution:
check if the filetype if javascript before matching the syntax

I am not totally sure, what is the purpose of matching that syntax,
but based on the commits that introduced it (7.4.670, 7.4.891),
I assume it is meant for javascript. At least it is not useful in C.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/18631

Commit Summary

  • d11a860 cindent: wrong indentation after an array declaration

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18631@github.com>

Christian Brabandt

unread,
Oct 26, 2025, 3:43:15 PM (6 days ago) Oct 26
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18631)

thanks


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18631/c3448860158@github.com>

Christian Brabandt

unread,
Oct 26, 2025, 3:50:25 PM (6 days ago) Oct 26
to vim/vim, Subscribed

Closed #18631 via 61ef8a3.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18631/issue_event/20511632468@github.com>

Reply all
Reply to author
Forward
0 new messages