From 9aa5647e686e5420e5b9b51828ec7d55631f98ed Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 10 May 2022 07:58:58 +0800 Subject: vim-patch:8.2.4911: the mode #defines are not clearly named (#18499) Problem: The mode #defines are not clearly named. Solution: Prepend MODE_. Renumber them to put the mapped modes first. https://github.com/vim/vim/commit/249591057b4840785c50e41dd850efb8a8faf435 A hunk from the patch depends on patch 8.2.4861, which hasn't been ported yet, but that should be easy to notice. --- src/nvim/indent_c.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/indent_c.c') diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index 54e7d72adc..06153267bc 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -1868,10 +1868,11 @@ int get_c_indent(void) * For unknown reasons the cursor might be past the end of the line, thus * check for that. */ - if ((State & INSERT) + if ((State & MODE_INSERT) && curwin->w_cursor.col < (colnr_T)STRLEN(linecopy) - && linecopy[curwin->w_cursor.col] == ')') + && linecopy[curwin->w_cursor.col] == ')') { linecopy[curwin->w_cursor.col] = NUL; + } theline = (char_u *)skipwhite((char *)linecopy); -- cgit