Problem: With cindent, a closing brace inside a comment (e.g. "// }")
causes wrong indentation of the following line, because
findmatchlimit() does not skip single-line comments when
searching backwards for a matching brace.
Solution: When searching backwards for a matching brace, always check
for single-line comments and skip bracket characters found
inside them. The forward search case is not yet handled.
fixes: #19578
Note: supported by AI claude
https://github.com/vim/vim/pull/19581
(3 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@chrisbra pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@zeertzjq commented on this pull request.
In src/testdir/test_cindent.vim:
> @@ -5527,4 +5527,194 @@ def Test_find_brace_backwards() enddef
There are two consecutive blank lines between these two functions.
⬇️ Suggested change-
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()