mirror of
https://github.com/neovim/neovim.git
synced 2026-05-06 08:26:45 -04:00
d9a7b68795
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: vim/vim#4
fixes: vim/vim#648
fixes: vim/vim#19578
closes: vim/vim#19581
closes: vim/vim#20111
https://github.com/vim/vim/commit/c06002f3cb07c374bfc1a1310cf13ee1914e86da
Co-authored-by: magnus-rattlehead <magnus-rattlehead@users.noreply.github.com>