0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.4.675

Problem:    When a FileReadPost autocommand moves the cursor inside a line it
            gets moved back.
Solution:   When checking whether an autocommand moved the cursor store the
            column as well. (Christian Brabandt)
This commit is contained in:
Bram Moolenaar
2015-03-24 11:46:30 +01:00
parent 77b7710d4e
commit eab316bdf9
2 changed files with 7 additions and 7 deletions

View File

@@ -3185,7 +3185,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
#endif #endif
int retval = FAIL; int retval = FAIL;
long n; long n;
linenr_T lnum; pos_T orig_pos;
linenr_T topline = 0; linenr_T topline = 0;
int newcol = -1; int newcol = -1;
int solcol = -1; int solcol = -1;
@@ -3678,7 +3678,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
* Careful: open_buffer() and apply_autocmds() may change the current * Careful: open_buffer() and apply_autocmds() may change the current
* buffer and window. * buffer and window.
*/ */
lnum = curwin->w_cursor.lnum; orig_pos = curwin->w_cursor;
topline = curwin->w_topline; topline = curwin->w_topline;
if (!oldbuf) /* need to read the file */ if (!oldbuf) /* need to read the file */
{ {
@@ -3719,11 +3719,9 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
check_arg_idx(curwin); check_arg_idx(curwin);
#endif #endif
/* /* If autocommands change the cursor position or topline, we should
* If autocommands change the cursor position or topline, we should * keep it. Also when it moves within a line. */
* keep it. if (!equalpos(curwin->w_cursor, orig_pos))
*/
if (curwin->w_cursor.lnum != lnum)
{ {
newlnum = curwin->w_cursor.lnum; newlnum = curwin->w_cursor.lnum;
newcol = curwin->w_cursor.col; newcol = curwin->w_cursor.col;

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 */
/**/
675,
/**/ /**/
674, 674,
/**/ /**/