aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorPavel Platto <hinidu@gmail.com>2015-01-19 22:34:23 +0200
committerPavel Platto <hinidu@gmail.com>2015-01-19 23:39:01 +0200
commit1d5222985ccad4cd31c4b7498810ff2968dd33a2 (patch)
tree4b8b0d7fe267d3a934e815ab5dc6130c941733f4 /src/nvim/edit.c
parent617c00bd49c2bdb05c8ef31f94e206ba3f80f694 (diff)
downloadrneovim-1d5222985ccad4cd31c4b7498810ff2968dd33a2.tar.gz
rneovim-1d5222985ccad4cd31c4b7498810ff2968dd33a2.tar.bz2
rneovim-1d5222985ccad4cd31c4b7498810ff2968dd33a2.zip
vim-patch:7.4.492
Problem: In Insert mode, after inserting a newline that inserts a comment leader, CTRL-O moves to the right. (ZyX) Issue 57. Solution: Correct the condition for moving the cursor back to the NUL. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-492
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. */