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
This commit is contained in:
Pavel Platto 2015-01-19 22:34:23 +02:00
parent 617c00bd49
commit 1d5222985c
3 changed files with 17 additions and 4 deletions

View File

@ -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. */

View File

@ -253,7 +253,7 @@ static int included_patches[] = {
//495 NA
494,
493,
//492,
492,
491,
490,
489,

View File

@ -46,6 +46,12 @@ describe('BufEnter with modelines', function()
-- Include Xxx in the current file
feed('G:r Xxx<CR>')
-- Vim issue #57 do not move cursor on <c-o> when autoindent is set
execute('set fo+=r')
feed('G')
feed('o# abcdef<Esc>2hi<CR><c-o>d0<Esc>')
feed('o# abcdef<Esc>2hi<c-o>d0<Esc>')
expect([[
startstart
start of test file Xxx
@ -63,7 +69,10 @@ describe('BufEnter with modelines', function()
this is a test
this is a test
this should be in column 1
end of test file Xxx]])
end of test file Xxx
# abc
def
def]])
end)
teardown(function()