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/cursor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nvim/cursor.c') diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index 6208efc9c8..11c734479c 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -95,8 +95,8 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a colnr_T col = 0; int head = 0; - int one_more = (State & INSERT) - || (State & TERM_FOCUS) + int one_more = (State & MODE_INSERT) + || (State & MODE_TERMINAL) || restart_edit != NUL || (VIsual_active && *p_sel != 'o') || ((get_ve_flags() & VE_ONEMORE) && wcol < MAXCOL); @@ -128,7 +128,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a } if (wcol / width > (colnr_T)csize / width - && ((State & INSERT) == 0 || (int)wcol > csize + 1)) { + && ((State & MODE_INSERT) == 0 || (int)wcol > csize + 1)) { // In case of line wrapping don't move the cursor beyond the // right screen edge. In Insert mode allow going just beyond // the last character (like what happens when typing and @@ -350,7 +350,7 @@ void check_cursor_col_win(win_T *win) // - in Insert mode or restarting Insert mode // - in Visual mode and 'selection' isn't "old" // - 'virtualedit' is set */ - if ((State & INSERT) || restart_edit + if ((State & MODE_INSERT) || restart_edit || (VIsual_active && *p_sel != 'o') || (cur_ve_flags & VE_ONEMORE) || virtual_active()) { -- cgit