aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/cursor.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-05-10 07:58:58 +0800
committerGitHub <noreply@github.com>2022-05-10 07:58:58 +0800
commit9aa5647e686e5420e5b9b51828ec7d55631f98ed (patch)
tree81172459aa5b8ac5c1f2e4e0b322e70267712ecd /src/nvim/cursor.c
parentc55867b46d6758c4ff2e55d1bfb4cfc163182a12 (diff)
downloadrneovim-9aa5647e686e5420e5b9b51828ec7d55631f98ed.tar.gz
rneovim-9aa5647e686e5420e5b9b51828ec7d55631f98ed.tar.bz2
rneovim-9aa5647e686e5420e5b9b51828ec7d55631f98ed.zip
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.
Diffstat (limited to 'src/nvim/cursor.c')
-rw-r--r--src/nvim/cursor.c8
1 files changed, 4 insertions, 4 deletions
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()) {