]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0447: cindent does not ignore comments v9.2.0447
authormagnus-rattlehead <magnus-rattlehead@users.noreply.github.com>
Tue, 5 May 2026 20:35:32 +0000 (20:35 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 5 May 2026 21:14:33 +0000 (21:14 +0000)
commitc06002f3cb07c374bfc1a1310cf13ee1914e86da
treea8dd401f8c9275faaa99db5466c757de8cbe600a
parent7ccc273a4cb6012e5afbdb94d0f2597bc01fe2fd
patch 9.2.0447: cindent does not ignore comments

Problem:  When find_start_brace() scans backwards for the enclosing
          block, '{' and '}' inside // and /* */ comments are counted,
          producing wrong indent for code following such comments
          (rendcrx).
Solution: Implement FM_SKIPCOMM in findmatchlimit() to track block-
          comment state and skip matches inside comments. Pass
          FM_SKIPCOMM from cindent's call sites
          (find_start_brace, find_match_char, cin_iswhileofdo,
          get_c_indent).

fixes:  #4
fixes:  #648
fixes:  #19578
closes: #19581
closes: #20111

Signed-off-by: magnus-rattlehead <guranjakustivi@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/version9.txt
src/cindent.c
src/search.c
src/testdir/test_cindent.vim
src/version.c
src/vim.h