0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

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)
This commit is contained in:
Bram Moolenaar
2014-10-31 19:20:36 +01:00
parent b851a96d5c
commit 2f31e39978
4 changed files with 14 additions and 2 deletions

View File

@@ -6916,8 +6916,12 @@ stop_insert(end_insert_pos, esc, nomove)
} }
if (curwin->w_cursor.lnum != tpos.lnum) if (curwin->w_cursor.lnum != tpos.lnum)
curwin->w_cursor = tpos; curwin->w_cursor = tpos;
else if (cc != NUL) else
++curwin->w_cursor.col; /* put cursor back on the NUL */ {
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 /* <C-S-Right> may have started Visual mode, adjust the position for
* deleted characters. */ * deleted characters. */

View File

@@ -17,6 +17,9 @@ othis should be auto-indented
G?this is a G?this is a
othis should be in column 1:wq " append text without autoindent to Xxx othis should be in column 1:wq " append text without autoindent to Xxx
G:r Xxx " include Xxx in the current file G:r Xxx " include Xxx in the current file
:set fo+=r " issue #57 do not move cursor on <c-o> when autoindent is set
Go# abcdef2hi
d0o# abcdef2hid0
:?startstart?,$w! test.out :?startstart?,$w! test.out
:qa! :qa!
ENDTEST ENDTEST

View File

@@ -15,3 +15,6 @@ vim: set noai :
this is a test this is a test
this should be in column 1 this should be in column 1
end of test file Xxx end of test file Xxx
# abc
def
def

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
492,
/**/ /**/
491, 491,
/**/ /**/