From b59eba3ada13ee3ceb0f8decebd261e55b2baa2d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 16 Feb 2026 07:39:02 +0800 Subject: vim-patch:9.2.0007: cindent: recognizing labels within commented lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Comment lines which start like a label are recognized as a label and indented based on that. Solution: Check if the position is in a comment after recognizing a label in cin_islabel (Anttoni Erkkilä) closes: vim/vim#19397 https://github.com/vim/vim/commit/9af18686c7842c8002268d861e37f6ad46a9b641 Co-authored-by: Anttoni Erkkilä --- src/nvim/indent_c.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index 2a30573a0b..40e22f8c9a 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -370,6 +370,9 @@ static bool cin_islabel(void) // XXX return false; } + if (ind_find_start_CORS(NULL)) { + return false; // Don't accept a label in a comment or a raw string. + } // Only accept a label if the previous line is terminated or is a case // label. pos_T cursor_save; -- cgit