diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds.c | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_ex_mode.vim | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index afded97a01..4c711d3ebc 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3874,6 +3874,7 @@ static int do_sub(exarg_T *eap, proftime_T timeout, long cmdpreview_ns, handle_T curwin->w_cursor.col = 0; } getvcol(curwin, &curwin->w_cursor, NULL, NULL, &ec); + curwin->w_cursor.col = regmatch.startpos[0].col; if (subflags.do_number || curwin->w_p_nu) { int numw = number_width(curwin) + 1; sc += numw; diff --git a/src/nvim/testdir/test_ex_mode.vim b/src/nvim/testdir/test_ex_mode.vim index 5cf4e9dd2c..2b8c5bebea 100644 --- a/src/nvim/testdir/test_ex_mode.vim +++ b/src/nvim/testdir/test_ex_mode.vim @@ -78,6 +78,9 @@ func Test_Ex_substitute() call WaitForAssert({-> assert_match(' 1 foo foo', term_getline(buf, 5))}, \ 1000) call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))}, 1000) + call term_sendkeys(buf, "N\<CR>") + call term_wait(buf) + call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))}, 1000) call term_sendkeys(buf, "n\<CR>") call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))}, \ 1000) |