diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-12-26 17:39:38 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-12-26 17:39:38 +0100 |
commit | 9040d7aed77388adae8ac672168e5e89257a4fd6 (patch) | |
tree | 79f0330d03030a333bdfa1f661300192e4df9404 | |
parent | f4e3c13bcc30a0254b01ec3fcfb5a683e961c040 (diff) | |
parent | e1abbe6b679ec1190173f957363899afbb366717 (diff) | |
download | rneovim-9040d7aed77388adae8ac672168e5e89257a4fd6.tar.gz rneovim-9040d7aed77388adae8ac672168e5e89257a4fd6.tar.bz2 rneovim-9040d7aed77388adae8ac672168e5e89257a4fd6.zip |
Merge pull request #3849 from Shougo/vim-7.4.675
vim-patch:7.4.675
-rw-r--r-- | src/nvim/ex_cmds.c | 12 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index d902234ef7..29cff5a2b2 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -1989,7 +1989,7 @@ do_ecmd ( char_u *free_fname = NULL; int retval = FAIL; long n; - linenr_T lnum; + pos_T orig_pos; linenr_T topline = 0; int newcol = -1; int solcol = -1; @@ -2351,7 +2351,7 @@ do_ecmd ( * Careful: open_buffer() and apply_autocmds() may change the current * buffer and window. */ - lnum = curwin->w_cursor.lnum; + orig_pos = curwin->w_cursor; topline = curwin->w_topline; if (!oldbuf) { /* need to read the file */ swap_exists_action = SEA_DIALOG; @@ -2379,11 +2379,9 @@ do_ecmd ( } check_arg_idx(curwin); - /* - * If autocommands change the cursor position or topline, we should - * keep it. - */ - if (curwin->w_cursor.lnum != lnum) { + // If autocommands change the cursor position or topline, we should keep + // it. Also when it moves within a line. + if (!equalpos(curwin->w_cursor, orig_pos)) { newlnum = curwin->w_cursor.lnum; newcol = curwin->w_cursor.col; } diff --git a/src/nvim/version.c b/src/nvim/version.c index 6f267d1582..b097ac4702 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -318,7 +318,7 @@ static int included_patches[] = { // 678 NA // 677 NA // 676 NA - // 675, + 675, // 674 NA 673, // 672, |