diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-10-31 19:20:36 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-10-31 19:20:36 +0100 |
commit | 2f31e399780f434c9635a1da969020824440e03b (patch) | |
tree | 37f34877a340a805d7ea6158bb720eccdf1d08cb /src/edit.c | |
parent | b851a96d5c201291d9e955afaf55979b3e410f9f (diff) | |
download | vim-git-2f31e399780f434c9635a1da969020824440e03b.tar.gz |
updated for version 7.4.492v7.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)
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/edit.c b/src/edit.c index 8243890c5..ee63daa1c 100644 --- a/src/edit.c +++ b/src/edit.c @@ -6916,8 +6916,12 @@ stop_insert(end_insert_pos, esc, nomove) } 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. */ |