aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 4c00547daa..f6ca11761a 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -5751,8 +5751,12 @@ stop_insert (
}
if (curwin->w_cursor.lnum != tpos.lnum)
curwin->w_cursor = tpos;
- else if (cc != NUL)
- ++curwin->w_cursor.col; /* put cursor back on the NUL */
+ else {
+ tpos.col++;
+ if (cc != NUL && gchar_pos(&tpos) == NUL) {
+ ++curwin->w_cursor.col; // put cursor back on the NUL
+ }
+ }
/* <C-S-Right> may have started Visual mode, adjust the position for
* deleted characters. */