0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

patch 8.2.2732: prompt for s///c in Ex mode can be wrong

Problem:    Prompt for s///c in Ex mode can be wrong.
Solution:   Position the cursor before showing the prompt. (closes #8073)
This commit is contained in:
Bram Moolenaar 2021-04-07 19:42:57 +02:00
parent 8dddc1f0e2
commit e5b0b98a90
3 changed files with 6 additions and 0 deletions

View File

@ -4153,6 +4153,7 @@ ex_substitute(exarg_T *eap)
if (curwin->w_cursor.col < 0) if (curwin->w_cursor.col < 0)
curwin->w_cursor.col = 0; curwin->w_cursor.col = 0;
getvcol(curwin, &curwin->w_cursor, NULL, NULL, &ec); getvcol(curwin, &curwin->w_cursor, NULL, NULL, &ec);
curwin->w_cursor.col = regmatch.startpos[0].col;
if (subflags.do_number || curwin->w_p_nu) if (subflags.do_number || curwin->w_p_nu)
{ {
int numw = number_width(curwin) + 1; int numw = number_width(curwin) + 1;

View File

@ -77,6 +77,9 @@ func Test_Ex_substitute()
call WaitForAssert({-> assert_match(' 1 foo foo', term_getline(buf, 5))}, call WaitForAssert({-> assert_match(' 1 foo foo', term_getline(buf, 5))},
\ 1000) \ 1000)
call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))}, 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 term_sendkeys(buf, "n\<CR>")
call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))}, call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))},
\ 1000) \ 1000)

View File

@ -750,6 +750,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 */
/**/
2732,
/**/ /**/
2731, 2731,
/**/ /**/