aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/cursor.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2025-02-05 23:09:29 +0000
committerJosh Rahm <joshuarahm@gmail.com>2025-02-05 23:09:29 +0000
commitd5f194ce780c95821a855aca3c19426576d28ae0 (patch)
treed45f461b19f9118ad2bb1f440a7a08973ad18832 /src/nvim/cursor.c
parentc5d770d311841ea5230426cc4c868e8db27300a8 (diff)
parent44740e561fc93afe3ebecfd3618bda2d2abeafb0 (diff)
downloadrneovim-rahm.tar.gz
rneovim-rahm.tar.bz2
rneovim-rahm.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309HEADrahm
Diffstat (limited to 'src/nvim/cursor.c')
-rw-r--r--src/nvim/cursor.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c
index 35afca2fe9..580ed856e4 100644
--- a/src/nvim/cursor.c
+++ b/src/nvim/cursor.c
@@ -11,6 +11,7 @@
#include "nvim/drawscreen.h"
#include "nvim/fold.h"
#include "nvim/globals.h"
+#include "nvim/macros_defs.h"
#include "nvim/mark.h"
#include "nvim/mbyte.h"
#include "nvim/mbyte_defs.h"
@@ -105,7 +106,7 @@ static int coladvance2(win_T *wp, pos_T *pos, bool addspaces, bool finetune, col
|| (State & MODE_TERMINAL)
|| restart_edit != NUL
|| (VIsual_active && *p_sel != 'o')
- || ((get_ve_flags(wp) & VE_ONEMORE) && wcol < MAXCOL);
+ || ((get_ve_flags(wp) & kOptVeFlagOnemore) && wcol < MAXCOL);
char *line = ml_get_buf(wp->w_buffer, pos->lnum);
int linelen = ml_get_buf_len(wp->w_buffer, pos->lnum);
@@ -341,11 +342,13 @@ void check_cursor_col(win_T *win)
} else if (win->w_cursor.col >= len) {
// Allow cursor past end-of-line when:
// - in Insert mode or restarting Insert mode
+ // - in Terminal mode
// - in Visual mode and 'selection' isn't "old"
// - 'virtualedit' is set
if ((State & MODE_INSERT) || restart_edit
+ || (State & MODE_TERMINAL)
|| (VIsual_active && *p_sel != 'o')
- || (cur_ve_flags & VE_ONEMORE)
+ || (cur_ve_flags & kOptVeFlagOnemore)
|| virtual_active(win)) {
win->w_cursor.col = len;
} else {
@@ -362,7 +365,7 @@ void check_cursor_col(win_T *win)
// line.
if (oldcol == MAXCOL) {
win->w_cursor.coladd = 0;
- } else if (cur_ve_flags == VE_ALL) {
+ } else if (cur_ve_flags == kOptVeFlagAll) {
if (oldcoladd > win->w_cursor.col) {
win->w_cursor.coladd = oldcoladd - win->w_cursor.col;