From b90f649ca2e240c1bfb22fe91247bc90314af1e1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 10 Mar 2025 07:43:27 +0800 Subject: vim-patch:9.1.1190: C indentation does not detect multibyte labels (#32808) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: C indentation does not detect multibyte labels Solution: Correctly skip over multibyte characters (Anttoni Erkkilä) closes: vim/vim#16770 https://github.com/vim/vim/commit/f4d87ff8883e5076633ef0ab0cf4d6e4beaddc5c Co-authored-by: Anttoni Erkkilä --- src/nvim/indent_c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index c9b7a1ba3f..307e800be7 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -15,6 +15,7 @@ #include "nvim/macros_defs.h" #include "nvim/mark_defs.h" #include "nvim/math.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/option.h" @@ -334,7 +335,7 @@ static bool cin_islabel_skip(const char **s) } while (vim_isIDc((uint8_t)(**s))) { - (*s)++; + (*s) += utfc_ptr2len(*s); } *s = cin_skipcomment(*s); -- cgit