Mercurial > vim
comparison src/edit.c @ 6318:5e998fc610d5 v7.4.492
updated for version 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)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 31 Oct 2014 19:20:36 +0100 |
parents | 1f578cd9a657 |
children | e6c5ff35500d |
comparison
equal
deleted
inserted
replaced
6317:7bcb17fdf87a | 6318:5e998fc610d5 |
---|---|
6914 if (del_char(TRUE) == FAIL) | 6914 if (del_char(TRUE) == FAIL) |
6915 break; /* should not happen */ | 6915 break; /* should not happen */ |
6916 } | 6916 } |
6917 if (curwin->w_cursor.lnum != tpos.lnum) | 6917 if (curwin->w_cursor.lnum != tpos.lnum) |
6918 curwin->w_cursor = tpos; | 6918 curwin->w_cursor = tpos; |
6919 else if (cc != NUL) | 6919 else |
6920 ++curwin->w_cursor.col; /* put cursor back on the NUL */ | 6920 { |
6921 tpos.col++; | |
6922 if (cc != NUL && gchar_pos(&tpos) == NUL) | |
6923 ++curwin->w_cursor.col; /* put cursor back on the NUL */ | |
6924 } | |
6921 | 6925 |
6922 /* <C-S-Right> may have started Visual mode, adjust the position for | 6926 /* <C-S-Right> may have started Visual mode, adjust the position for |
6923 * deleted characters. */ | 6927 * deleted characters. */ |
6924 if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum) | 6928 if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum) |
6925 { | 6929 { |