mirror of
https://github.com/neovim/neovim.git
synced 2026-06-18 01:31:14 +00:00
vim-patch:9.2.0610: cindent: closing brace in a comment affects the next line's indent (#40155)
Problem: A '}' inside a // line comment changes the indentation of the
following line inside an enum or struct (rendcrx).
Solution: Stop scanning the line once a line comment is reached, so a brace
inside the comment is no longer mistaken for an unmatched brace.
fixes: vim/vim#20455
closes: vim/vim#20458
9dd86dff9b
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1597,6 +1597,9 @@ static int find_last_paren(const char *l, char start, char end)
|
||||
|
||||
for (i = 0; l[i] != NUL; i++) {
|
||||
i = (int)(cin_skipcomment(l + i) - l); // ignore parens in comments
|
||||
if (l[i] == NUL) {
|
||||
break;
|
||||
}
|
||||
i = (int)(skip_string(l + i) - l); // ignore parens in quotes
|
||||
if (l[i] == start) {
|
||||
open_count++;
|
||||
|
||||
Reference in New Issue
Block a user